From c82c80d031d50e445bda7c02adbd3e97a635cde6 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Thu, 2 Aug 2018 14:08:35 +0200 Subject: Put "syntax" at the bottom --- sinksh/syntax_modules/sink_inspect.cpp | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'sinksh/syntax_modules/sink_inspect.cpp') 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) } } -bool inspect(const QStringList &args, State &state); - -Syntax::List syntax() -{ - Syntax state("inspect", QObject::tr("Inspect database for the resource requested"), - &SinkInspect::inspect, Syntax::NotInteractive); - - state.addParameter("resource", - { .name = "resource", .help = "Which resource to inspect", .required = true }); - state.addParameter("db", - { .name = "database", .help = "Which database to inspect"}); - state.addParameter("filter", - { .name = "id", .help = "A specific id to filter the results by (currently not working)"}); - state.addFlag("showinternal", "Show internal fields only"); - state.addParameter("validaterids", - { .name = "type", .help = "Validate remote Ids of the given type"}); - state.addParameter("fulltext", - { .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"}); - - state.completer = &SinkshUtils::resourceCompleter; - - return Syntax::List() << state; -} - -REGISTER_SYNTAX(SinkInspect) +Syntax::List syntax(); bool inspect(const QStringList &args, State &state) { @@ -262,4 +238,28 @@ bool inspect(const QStringList &args, State &state) return false; } +Syntax::List syntax() +{ + Syntax state("inspect", QObject::tr("Inspect database for the resource requested"), + &SinkInspect::inspect, Syntax::NotInteractive); + + state.addParameter("resource", + { .name = "resource", .help = "Which resource to inspect", .required = true }); + state.addParameter("db", + { .name = "database", .help = "Which database to inspect"}); + state.addParameter("filter", + { .name = "id", .help = "A specific id to filter the results by (currently not working)"}); + state.addFlag("showinternal", "Show internal fields only"); + state.addParameter("validaterids", + { .name = "type", .help = "Validate remote Ids of the given type"}); + state.addParameter("fulltext", + { .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"}); + + state.completer = &SinkshUtils::resourceCompleter; + + return Syntax::List() << state; +} + +REGISTER_SYNTAX(SinkInspect) + } -- cgit v1.2.3