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_count.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sinksh/syntax_modules/sink_count.cpp') diff --git a/sinksh/syntax_modules/sink_count.cpp b/sinksh/syntax_modules/sink_count.cpp index aaa9c33..1edf1c2 100644 --- a/sinksh/syntax_modules/sink_count.cpp +++ b/sinksh/syntax_modules/sink_count.cpp @@ -37,21 +37,7 @@ namespace SinkCount { -bool count(const QStringList &args, State &state); - -Syntax::List syntax() -{ - Syntax count("count", QObject::tr("Returns the number of items of a given type in a resource"), &SinkCount::count, Syntax::EventDriven); - - count.addPositionalArgument({.name = "type", .help = "The entity type to count"}); - count.addPositionalArgument({.name = "resource", .help = "A resource id where to count", .required = false}); - - count.completer = &SinkshUtils::typeCompleter; - - return Syntax::List() << count; -} - -REGISTER_SYNTAX(SinkCount) +Syntax::List syntax(); bool count(const QStringList &args, State &state) { @@ -77,4 +63,18 @@ bool count(const QStringList &args, State &state) return true; } +Syntax::List syntax() +{ + Syntax count("count", QObject::tr("Returns the number of items of a given type in a resource"), &SinkCount::count, Syntax::EventDriven); + + count.addPositionalArgument({.name = "type", .help = "The entity type to count"}); + count.addPositionalArgument({.name = "resource", .help = "A resource id where to count", .required = false}); + + count.completer = &SinkshUtils::typeCompleter; + + return Syntax::List() << count; +} + +REGISTER_SYNTAX(SinkCount) + } -- cgit v1.2.3