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_remove.cpp | 55 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'sinksh/syntax_modules/sink_remove.cpp') diff --git a/sinksh/syntax_modules/sink_remove.cpp b/sinksh/syntax_modules/sink_remove.cpp index f948290..999a889 100644 --- a/sinksh/syntax_modules/sink_remove.cpp +++ b/sinksh/syntax_modules/sink_remove.cpp @@ -37,35 +37,7 @@ namespace SinkRemove { -bool remove(const QStringList &args, State &state); -bool resource(const QStringList &args, State &state); -bool account(const QStringList &args, State &state); -bool identity(const QStringList &args, State &state); - -Syntax::List syntax() -{ - Syntax remove("remove", QObject::tr("Remove items in a resource"), &SinkRemove::remove); - - remove.addPositionalArgument({ .name = "type", .help = "The type of entity to remove (mail, event, etc.)" }); - remove.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource containing the entity" }); - remove.addPositionalArgument({ .name = "objectId", .help = "The ID of the entity to remove" }); - - Syntax resource("resource", QObject::tr("Removes a resource"), &SinkRemove::resource, Syntax::NotInteractive); - resource.addPositionalArgument({ .name = "id", .help = "The ID of the resource to remove" }); - resource.completer = &SinkshUtils::resourceCompleter; - - Syntax account("account", QObject::tr("Removes a account"), &SinkRemove::account, Syntax::NotInteractive); - account.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); - - Syntax identity("identity", QObject::tr("Removes an identity"), &SinkRemove::identity, Syntax::NotInteractive); - identity.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); - - remove.children << resource << account << identity; - - return Syntax::List() << remove; -} - -REGISTER_SYNTAX(SinkRemove) +Syntax::List syntax(); bool remove(const QStringList &args, State &state) { @@ -157,4 +129,29 @@ bool identity(const QStringList &args, State &state) return true; } +Syntax::List syntax() +{ + Syntax remove("remove", QObject::tr("Remove items in a resource"), &SinkRemove::remove); + + remove.addPositionalArgument({ .name = "type", .help = "The type of entity to remove (mail, event, etc.)" }); + remove.addPositionalArgument({ .name = "resourceId", .help = "The ID of the resource containing the entity" }); + remove.addPositionalArgument({ .name = "objectId", .help = "The ID of the entity to remove" }); + + Syntax resource("resource", QObject::tr("Removes a resource"), &SinkRemove::resource, Syntax::NotInteractive); + resource.addPositionalArgument({ .name = "id", .help = "The ID of the resource to remove" }); + resource.completer = &SinkshUtils::resourceCompleter; + + Syntax account("account", QObject::tr("Removes a account"), &SinkRemove::account, Syntax::NotInteractive); + account.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); + + Syntax identity("identity", QObject::tr("Removes an identity"), &SinkRemove::identity, Syntax::NotInteractive); + identity.addPositionalArgument({ .name = "id", .help = "The ID of the account to remove" }); + + remove.children << resource << account << identity; + + return Syntax::List() << remove; +} + +REGISTER_SYNTAX(SinkRemove) + } -- cgit v1.2.3