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_livequery.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_livequery.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_livequery.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sinksh/syntax_modules/sink_livequery.cpp b/sinksh/syntax_modules/sink_livequery.cpp index 0acaaeb..2d8d5d0 100644 --- a/sinksh/syntax_modules/sink_livequery.cpp +++ b/sinksh/syntax_modules/sink_livequery.cpp | |||
@@ -38,25 +38,7 @@ | |||
38 | namespace SinkLiveQuery | 38 | namespace SinkLiveQuery |
39 | { | 39 | { |
40 | 40 | ||
41 | bool livequery(const QStringList &args_, State &state); | 41 | Syntax::List syntax(); |
42 | |||
43 | Syntax::List syntax() | ||
44 | { | ||
45 | Syntax list("livequery", QObject::tr("Run a livequery."), &SinkLiveQuery::livequery, Syntax::EventDriven); | ||
46 | |||
47 | list.addPositionalArgument({ .name = "type", .help = "The type to run the livequery on" }); | ||
48 | list.addParameter("resource", { .name = "resource", .help = "Filter the livequery to the given resource" }); | ||
49 | list.addFlag("compact", "Use a compact view (reduces the size of IDs)"); | ||
50 | list.addParameter("filter", { .name = "property=$value", .help = "Filter the results" }); | ||
51 | list.addParameter("id", { .name = "id", .help = "List only the content with the given ID" }); | ||
52 | list.addFlag("showall", "Show all properties"); | ||
53 | list.addParameter("show", { .name = "property", .help = "Only show the given property" }); | ||
54 | |||
55 | list.completer = &SinkshUtils::resourceOrTypeCompleter; | ||
56 | return Syntax::List() << list; | ||
57 | } | ||
58 | |||
59 | REGISTER_SYNTAX(SinkLiveQuery) | ||
60 | 42 | ||
61 | bool livequery(const QStringList &args_, State &state) | 43 | bool livequery(const QStringList &args_, State &state) |
62 | { | 44 | { |
@@ -141,4 +123,22 @@ bool livequery(const QStringList &args_, State &state) | |||
141 | return false; | 123 | return false; |
142 | } | 124 | } |
143 | 125 | ||
126 | Syntax::List syntax() | ||
127 | { | ||
128 | Syntax list("livequery", QObject::tr("Run a livequery."), &SinkLiveQuery::livequery, Syntax::EventDriven); | ||
129 | |||
130 | list.addPositionalArgument({ .name = "type", .help = "The type to run the livequery on" }); | ||
131 | list.addParameter("resource", { .name = "resource", .help = "Filter the livequery to the given resource" }); | ||
132 | list.addFlag("compact", "Use a compact view (reduces the size of IDs)"); | ||
133 | list.addParameter("filter", { .name = "property=$value", .help = "Filter the results" }); | ||
134 | list.addParameter("id", { .name = "id", .help = "List only the content with the given ID" }); | ||
135 | list.addFlag("showall", "Show all properties"); | ||
136 | list.addParameter("show", { .name = "property", .help = "Only show the given property" }); | ||
137 | |||
138 | list.completer = &SinkshUtils::resourceOrTypeCompleter; | ||
139 | return Syntax::List() << list; | ||
140 | } | ||
141 | |||
142 | REGISTER_SYNTAX(SinkLiveQuery) | ||
143 | |||
144 | } | 144 | } |