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_inspect.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_inspect.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_inspect.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/sinksh/syntax_modules/sink_inspect.cpp b/sinksh/syntax_modules/sink_inspect.cpp index d952a9b..355efa3 100644 --- a/sinksh/syntax_modules/sink_inspect.cpp +++ b/sinksh/syntax_modules/sink_inspect.cpp | |||
@@ -55,31 +55,7 @@ QString parse(const QByteArray &bytes) | |||
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | bool inspect(const QStringList &args, State &state); | 58 | Syntax::List syntax(); |
59 | |||
60 | Syntax::List syntax() | ||
61 | { | ||
62 | Syntax state("inspect", QObject::tr("Inspect database for the resource requested"), | ||
63 | &SinkInspect::inspect, Syntax::NotInteractive); | ||
64 | |||
65 | state.addParameter("resource", | ||
66 | { .name = "resource", .help = "Which resource to inspect", .required = true }); | ||
67 | state.addParameter("db", | ||
68 | { .name = "database", .help = "Which database to inspect"}); | ||
69 | state.addParameter("filter", | ||
70 | { .name = "id", .help = "A specific id to filter the results by (currently not working)"}); | ||
71 | state.addFlag("showinternal", "Show internal fields only"); | ||
72 | state.addParameter("validaterids", | ||
73 | { .name = "type", .help = "Validate remote Ids of the given type"}); | ||
74 | state.addParameter("fulltext", | ||
75 | { .name = "id", .help = "If 'id' is not given, count the number of fulltext documents. Else, print the terms of the document with the given id"}); | ||
76 | |||
77 | state.completer = &SinkshUtils::resourceCompleter; | ||
78 | |||
79 | return Syntax::List() << state; | ||
80 | } | ||
81 | |||
82 | REGISTER_SYNTAX(SinkInspect) | ||
83 | 59 | ||
84 | bool inspect(const QStringList &args, State &state) | 60 | bool inspect(const QStringList &args, State &state) |
85 | { | 61 | { |
@@ -262,4 +238,28 @@ bool inspect(const QStringList &args, State &state) | |||
262 | return false; | 238 | return false; |
263 | } | 239 | } |
264 | 240 | ||
241 | Syntax::List syntax() | ||
242 | { | ||
243 | Syntax state("inspect", QObject::tr("Inspect database for the resource requested"), | ||
244 | &SinkInspect::inspect, Syntax::NotInteractive); | ||
245 | |||
246 | state.addParameter("resource", | ||
247 | { .name = "resource", .help = "Which resource to inspect", .required = true }); | ||
248 | state.addParameter("db", | ||
249 | { .name = "database", .help = "Which database to inspect"}); | ||
250 | state.addParameter("filter", | ||
251 | { .name = "id", .help = "A specific id to filter the results by (currently not working)"}); | ||
252 | state.addFlag("showinternal", "Show internal fields only"); | ||
253 | state.addParameter("validaterids", | ||
254 | { .name = "type", .help = "Validate remote Ids of the given type"}); | ||
255 | state.addParameter("fulltext", | ||
256 | { .name = "id", .help = "If 'id' is not given, count the number of fulltext documents. Else, print the terms of the document with the given id"}); | ||
257 | |||
258 | state.completer = &SinkshUtils::resourceCompleter; | ||
259 | |||
260 | return Syntax::List() << state; | ||
261 | } | ||
262 | |||
263 | REGISTER_SYNTAX(SinkInspect) | ||
264 | |||
265 | } | 265 | } |