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_list.cpp | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'sinksh/syntax_modules/sink_list.cpp') diff --git a/sinksh/syntax_modules/sink_list.cpp b/sinksh/syntax_modules/sink_list.cpp index c091cd4..903dc2a 100644 --- a/sinksh/syntax_modules/sink_list.cpp +++ b/sinksh/syntax_modules/sink_list.cpp @@ -39,28 +39,7 @@ namespace SinkList { -bool list(const QStringList &args_, State &state); - -Syntax::List syntax() -{ - Syntax list("list", QObject::tr("List all resources, or the contents of one or more resources."), &SinkList::list, Syntax::NotInteractive); - - list.addPositionalArgument({.name = "type", .help = "The type of content to list (resource, identity, account, mail, etc.)"}); - list.addParameter("resource", { .name = "resource", .help = "List only the content of the given resource" }); - list.addFlag("compact", "Use a compact view (reduces the size of IDs)"); - list.addParameter("filter", { .name = "property=$value", .help = "Filter the results" }); - list.addParameter("id", { .name = "id", .help = "List only the content with the given ID" }); - list.addFlag("showall", "Show all properties"); - list.addParameter("show", { .name = "property", .help = "Only show the given property" }); - list.addParameter("reduce", { .name = "property:$selectorProperty", .help = "Combine the result with the same $property, sorted by $selectorProperty" }); - list.addParameter("sort", { .name = "property", .help = "Sort the results according to the given property" }); - list.addParameter("limit", { .name = "count", .help = "Limit the results" }); - - list.completer = &SinkshUtils::resourceOrTypeCompleter; - return Syntax::List() << list; -} - -REGISTER_SYNTAX(SinkList) +Syntax::List syntax(); static QByteArray compressId(bool compress, const QByteArray &id) { @@ -216,4 +195,25 @@ bool list(const QStringList &args_, State &state) return true; } +Syntax::List syntax() +{ + Syntax list("list", QObject::tr("List all resources, or the contents of one or more resources."), &SinkList::list, Syntax::NotInteractive); + + list.addPositionalArgument({.name = "type", .help = "The type of content to list (resource, identity, account, mail, etc.)"}); + list.addParameter("resource", { .name = "resource", .help = "List only the content of the given resource" }); + list.addFlag("compact", "Use a compact view (reduces the size of IDs)"); + list.addParameter("filter", { .name = "property=$value", .help = "Filter the results" }); + list.addParameter("id", { .name = "id", .help = "List only the content with the given ID" }); + list.addFlag("showall", "Show all properties"); + list.addParameter("show", { .name = "property", .help = "Only show the given property" }); + list.addParameter("reduce", { .name = "property:$selectorProperty", .help = "Combine the result with the same $property, sorted by $selectorProperty" }); + list.addParameter("sort", { .name = "property", .help = "Sort the results according to the given property" }); + list.addParameter("limit", { .name = "count", .help = "Limit the results" }); + + list.completer = &SinkshUtils::resourceOrTypeCompleter; + return Syntax::List() << list; +} + +REGISTER_SYNTAX(SinkList) + } -- cgit v1.2.3