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.cpp32
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 @@
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
57bool sync(const QStringList &args, State &state) 40bool 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
83Syntax::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
96REGISTER_SYNTAX(SinkSync)
97
100} 98}