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_modify.cpp | 49 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'sinksh/syntax_modules/sink_modify.cpp') diff --git a/sinksh/syntax_modules/sink_modify.cpp b/sinksh/syntax_modules/sink_modify.cpp index cd29d56..6cda5ab 100644 --- a/sinksh/syntax_modules/sink_modify.cpp +++ b/sinksh/syntax_modules/sink_modify.cpp @@ -38,31 +38,7 @@ namespace SinkModify { -bool modify(const QStringList &args, State &state); -bool resource(const QStringList &args, State &state); - -Syntax::List syntax() -{ - Syntax modify("modify", QObject::tr("Modify items in a resource"), &SinkModify::modify); - modify.addPositionalArgument({ .name = "type", .help = "The type of entity to modify (mail, event, etc.)" }); - modify.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource containing the entity" }); - modify.addPositionalArgument({ .name = "objectId", .help = "The ID of the entity" }); - modify.addPositionalArgument( - { .name = "key value", .help = "Attributes and values to modify", .required = false, .variadic = true }); - - Syntax resource("resource", QObject::tr("Modify a resource"), &SinkModify::resource);//, Syntax::EventDriven); - - resource.addPositionalArgument({ .name = "id", .help = "The ID of the resource" }); - resource.addPositionalArgument( - { .name = "key value", .help = "Attributes and values to modify", .required = false, .variadic = true }); - - resource.completer = &SinkshUtils::resourceOrTypeCompleter; - modify.children << resource; - - return Syntax::List() << modify; -} - -REGISTER_SYNTAX(SinkModify) +Syntax::List syntax(); bool modify(const QStringList &args, State &state) { @@ -122,4 +98,27 @@ bool resource(const QStringList &args, State &state) return true; } +Syntax::List syntax() +{ + Syntax modify("modify", QObject::tr("Modify items in a resource"), &SinkModify::modify); + modify.addPositionalArgument({ .name = "type", .help = "The type of entity to modify (mail, event, etc.)" }); + modify.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource containing the entity" }); + modify.addPositionalArgument({ .name = "objectId", .help = "The ID of the entity" }); + modify.addPositionalArgument( + { .name = "key value", .help = "Attributes and values to modify", .required = false, .variadic = true }); + + Syntax resource("resource", QObject::tr("Modify a resource"), &SinkModify::resource);//, Syntax::EventDriven); + + resource.addPositionalArgument({ .name = "id", .help = "The ID of the resource" }); + resource.addPositionalArgument( + { .name = "key value", .help = "Attributes and values to modify", .required = false, .variadic = true }); + + resource.completer = &SinkshUtils::resourceOrTypeCompleter; + modify.children << resource; + + return Syntax::List() << modify; +} + +REGISTER_SYNTAX(SinkModify) + } -- cgit v1.2.3