summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules/sink_inspect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/syntax_modules/sink_inspect.cpp')
-rw-r--r--sinksh/syntax_modules/sink_inspect.cpp50
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
58bool inspect(const QStringList &args, State &state); 58Syntax::List syntax();
59
60Syntax::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
82REGISTER_SYNTAX(SinkInspect)
83 59
84bool inspect(const QStringList &args, State &state) 60bool 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
241Syntax::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
263REGISTER_SYNTAX(SinkInspect)
264
265} 265}