diff options
Diffstat (limited to 'sinksh/syntax_modules/sink_drop.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_drop.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sinksh/syntax_modules/sink_drop.cpp b/sinksh/syntax_modules/sink_drop.cpp index 3b9a817..eaa3041 100644 --- a/sinksh/syntax_modules/sink_drop.cpp +++ b/sinksh/syntax_modules/sink_drop.cpp | |||
@@ -35,10 +35,12 @@ | |||
35 | namespace SinkDrop | 35 | namespace SinkDrop |
36 | { | 36 | { |
37 | 37 | ||
38 | Syntax::List syntax(); | ||
39 | |||
38 | bool drop(const QStringList &args, State &state) | 40 | bool drop(const QStringList &args, State &state) |
39 | { | 41 | { |
40 | if (args.isEmpty()) { | 42 | if (args.isEmpty()) { |
41 | state.printError(QObject::tr("Please provide at least one resource to drop.")); | 43 | state.printError(syntax()[0].usage()); |
42 | return false; | 44 | return false; |
43 | } | 45 | } |
44 | 46 | ||
@@ -60,6 +62,8 @@ bool drop(const QStringList &args, State &state) | |||
60 | Syntax::List syntax() | 62 | Syntax::List syntax() |
61 | { | 63 | { |
62 | Syntax drop("drop", QObject::tr("Drop all caches of a resource."), &SinkDrop::drop, Syntax::NotInteractive); | 64 | Syntax drop("drop", QObject::tr("Drop all caches of a resource."), &SinkDrop::drop, Syntax::NotInteractive); |
65 | drop.addPositionalArgument({.name = "resource", .help = "Id(s) of the resource(s) to drop", .required = true, .variadic = true}); | ||
66 | |||
63 | drop.completer = &SinkshUtils::resourceOrTypeCompleter; | 67 | drop.completer = &SinkshUtils::resourceOrTypeCompleter; |
64 | return Syntax::List() << drop; | 68 | return Syntax::List() << drop; |
65 | } | 69 | } |