summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules/sink_livequery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/syntax_modules/sink_livequery.cpp')
-rw-r--r--sinksh/syntax_modules/sink_livequery.cpp38
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 @@
38namespace SinkLiveQuery 38namespace SinkLiveQuery
39{ 39{
40 40
41bool livequery(const QStringList &args_, State &state); 41Syntax::List syntax();
42
43Syntax::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
59REGISTER_SYNTAX(SinkLiveQuery)
60 42
61bool livequery(const QStringList &args_, State &state) 43bool 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
126Syntax::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
142REGISTER_SYNTAX(SinkLiveQuery)
143
144} 144}