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_remove.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_remove.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_remove.cpp | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/sinksh/syntax_modules/sink_remove.cpp b/sinksh/syntax_modules/sink_remove.cpp index f948290..999a889 100644 --- a/sinksh/syntax_modules/sink_remove.cpp +++ b/sinksh/syntax_modules/sink_remove.cpp | |||
@@ -37,35 +37,7 @@ | |||
37 | namespace SinkRemove | 37 | namespace SinkRemove |
38 | { | 38 | { |
39 | 39 | ||
40 | bool remove(const QStringList &args, State &state); | 40 | Syntax::List syntax(); |
41 | bool resource(const QStringList &args, State &state); | ||
42 | bool account(const QStringList &args, State &state); | ||
43 | bool identity(const QStringList &args, State &state); | ||
44 | |||
45 | Syntax::List syntax() | ||
46 | { | ||
47 | Syntax remove("remove", QObject::tr("Remove items in a resource"), &SinkRemove::remove); | ||
48 | |||
49 | remove.addPositionalArgument({ .name = "type", .help = "The type of entity to remove (mail, event, etc.)" }); | ||
50 | remove.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource containing the entity" }); | ||
51 | remove.addPositionalArgument({ .name = "objectId", .help = "The ID of the entity to remove" }); | ||
52 | |||
53 | Syntax resource("resource", QObject::tr("Removes a resource"), &SinkRemove::resource, Syntax::NotInteractive); | ||
54 | resource.addPositionalArgument({ .name = "id", .help = "The ID of the resource to remove" }); | ||
55 | resource.completer = &SinkshUtils::resourceCompleter; | ||
56 | |||
57 | Syntax account("account", QObject::tr("Removes a account"), &SinkRemove::account, Syntax::NotInteractive); | ||
58 | account.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); | ||
59 | |||
60 | Syntax identity("identity", QObject::tr("Removes an identity"), &SinkRemove::identity, Syntax::NotInteractive); | ||
61 | identity.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); | ||
62 | |||
63 | remove.children << resource << account << identity; | ||
64 | |||
65 | return Syntax::List() << remove; | ||
66 | } | ||
67 | |||
68 | REGISTER_SYNTAX(SinkRemove) | ||
69 | 41 | ||
70 | bool remove(const QStringList &args, State &state) | 42 | bool remove(const QStringList &args, State &state) |
71 | { | 43 | { |
@@ -157,4 +129,29 @@ bool identity(const QStringList &args, State &state) | |||
157 | return true; | 129 | return true; |
158 | } | 130 | } |
159 | 131 | ||
132 | Syntax::List syntax() | ||
133 | { | ||
134 | Syntax remove("remove", QObject::tr("Remove items in a resource"), &SinkRemove::remove); | ||
135 | |||
136 | remove.addPositionalArgument({ .name = "type", .help = "The type of entity to remove (mail, event, etc.)" }); | ||
137 | remove.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource containing the entity" }); | ||
138 | remove.addPositionalArgument({ .name = "objectId", .help = "The ID of the entity to remove" }); | ||
139 | |||
140 | Syntax resource("resource", QObject::tr("Removes a resource"), &SinkRemove::resource, Syntax::NotInteractive); | ||
141 | resource.addPositionalArgument({ .name = "id", .help = "The ID of the resource to remove" }); | ||
142 | resource.completer = &SinkshUtils::resourceCompleter; | ||
143 | |||
144 | Syntax account("account", QObject::tr("Removes a account"), &SinkRemove::account, Syntax::NotInteractive); | ||
145 | account.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); | ||
146 | |||
147 | Syntax identity("identity", QObject::tr("Removes an identity"), &SinkRemove::identity, Syntax::NotInteractive); | ||
148 | identity.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); | ||
149 | |||
150 | remove.children << resource << account << identity; | ||
151 | |||
152 | return Syntax::List() << remove; | ||
153 | } | ||
154 | |||
155 | REGISTER_SYNTAX(SinkRemove) | ||
156 | |||
160 | } | 157 | } |