diff options
author | Minijackson <minijackson@riseup.net> | 2018-08-02 14:08:35 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-08-02 14:08:35 +0200 |
commit | c82c80d031d50e445bda7c02adbd3e97a635cde6 (patch) | |
tree | 7ac90aaa7c8ac9561dfd10d730052a38c07b01ee /sinksh/syntax_modules/sink_sync.cpp | |
parent | 80c42b9707c7c44b7379734575c1b82fc97e95bf (diff) | |
download | sinksh-better-cli.tar.gz sinksh-better-cli.zip |
Put "syntax" at the bottomsinksh-better-cli
Diffstat (limited to 'sinksh/syntax_modules/sink_sync.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_sync.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/sinksh/syntax_modules/sink_sync.cpp b/sinksh/syntax_modules/sink_sync.cpp index ee19f0a..e13e8f8 100644 --- a/sinksh/syntax_modules/sink_sync.cpp +++ b/sinksh/syntax_modules/sink_sync.cpp | |||
@@ -37,23 +37,6 @@ | |||
37 | namespace SinkSync | 37 | namespace SinkSync |
38 | { | 38 | { |
39 | 39 | ||
40 | bool sync(const QStringList &args, State &state); | ||
41 | |||
42 | Syntax::List syntax() | ||
43 | { | ||
44 | Syntax sync("sync", QObject::tr("Synchronizes a resource."), &SinkSync::sync, Syntax::EventDriven); | ||
45 | |||
46 | sync.addPositionalArgument({ .name = "type", .help = "The type of resource to synchronize" }); | ||
47 | sync.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource to synchronize" }); | ||
48 | sync.addParameter("password", { .name = "password", .help = "The password of the resource", .required = true }); | ||
49 | |||
50 | sync.completer = &SinkshUtils::resourceCompleter; | ||
51 | |||
52 | return Syntax::List() << sync; | ||
53 | } | ||
54 | |||
55 | REGISTER_SYNTAX(SinkSync) | ||
56 | |||
57 | bool sync(const QStringList &args, State &state) | 40 | bool sync(const QStringList &args, State &state) |
58 | { | 41 | { |
59 | auto options = SyntaxTree::parseOptions(args); | 42 | auto options = SyntaxTree::parseOptions(args); |
@@ -97,4 +80,19 @@ bool sync(const QStringList &args, State &state) | |||
97 | return true; | 80 | return true; |
98 | } | 81 | } |
99 | 82 | ||
83 | Syntax::List syntax() | ||
84 | { | ||
85 | Syntax sync("sync", QObject::tr("Synchronizes a resource."), &SinkSync::sync, Syntax::EventDriven); | ||
86 | |||
87 | sync.addPositionalArgument({ .name = "type", .help = "The type of resource to synchronize" }); | ||
88 | sync.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource to synchronize" }); | ||
89 | sync.addParameter("password", { .name = "password", .help = "The password of the resource", .required = true }); | ||
90 | |||
91 | sync.completer = &SinkshUtils::resourceCompleter; | ||
92 | |||
93 | return Syntax::List() << sync; | ||
94 | } | ||
95 | |||
96 | REGISTER_SYNTAX(SinkSync) | ||
97 | |||
100 | } | 98 | } |