summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules/sink_sync.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/syntax_modules/sink_sync.cpp')
-rw-r--r--sinksh/syntax_modules/sink_sync.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/sinksh/syntax_modules/sink_sync.cpp b/sinksh/syntax_modules/sink_sync.cpp
index f165f58..ee19f0a 100644
--- a/sinksh/syntax_modules/sink_sync.cpp
+++ b/sinksh/syntax_modules/sink_sync.cpp
@@ -37,6 +37,23 @@
37namespace SinkSync 37namespace SinkSync
38{ 38{
39 39
40bool sync(const QStringList &args, State &state);
41
42Syntax::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
55REGISTER_SYNTAX(SinkSync)
56
40bool sync(const QStringList &args, State &state) 57bool sync(const QStringList &args, State &state)
41{ 58{
42 auto options = SyntaxTree::parseOptions(args); 59 auto options = SyntaxTree::parseOptions(args);
@@ -80,14 +97,4 @@ bool sync(const QStringList &args, State &state)
80 return true; 97 return true;
81} 98}
82 99
83Syntax::List syntax()
84{
85 Syntax sync("sync", QObject::tr("Synchronizes a resource."), &SinkSync::sync, Syntax::EventDriven);
86 sync.completer = &SinkshUtils::resourceCompleter;
87
88 return Syntax::List() << sync;
89}
90
91REGISTER_SYNTAX(SinkSync)
92
93} 100}