diff --git a/tom/src/tom/application.cpp b/tom/src/tom/application.cpp index b8f05b553..3bb9c1747 100644 --- a/tom/src/tom/application.cpp +++ b/tom/src/tom/application.cpp @@ -258,13 +258,18 @@ void Application::initializeParser(QCommandLineParser &parser) { noansi, QStringLiteral("Disable ANSI output")}, { env, QStringLiteral("The environment the command should run " "under"), env_up}, // Value - {{"h", help}, QStringLiteral("Display help for the given command. When " + {{QChar('h'), + help}, QStringLiteral("Display help for the given command. When " "no command is given display help for the " "list command")}, - {{"n", nointeraction}, QStringLiteral("Do not ask any interactive question")}, - {{"q", quiet}, QStringLiteral("Do not output any message")}, - {{"V", version}, QStringLiteral("Display this application version")}, - {{"v", verbose}, QStringLiteral("Increase the verbosity of messages: " + {{QChar('n'), + nointeraction}, QStringLiteral("Do not ask any interactive question")}, + {{QChar('q'), + quiet}, QStringLiteral("Do not output any message")}, + {{QChar('V'), + version}, QStringLiteral("Display this application version")}, + {{QChar('v'), + verbose}, QStringLiteral("Increase the verbosity of messages: " "1 for normal output, " "2 for more verbose output and " "3 for debug")}, diff --git a/tom/src/tom/commands/database/seedcommand.cpp b/tom/src/tom/commands/database/seedcommand.cpp index 5a42a3e84..89152da8e 100644 --- a/tom/src/tom/commands/database/seedcommand.cpp +++ b/tom/src/tom/commands/database/seedcommand.cpp @@ -55,12 +55,13 @@ const std::vector &SeedCommand::positionalArguments() const QList SeedCommand::optionsSignature() const { return { - {class_, QStringLiteral("The class name of the root seeder"), class_up, - DatabaseSeeder}, // Value - {database_, QStringLiteral("The database connection to use " - "(multiple values allowed)"), - database_up}, // Value - {force, QStringLiteral("Force the operation to run when in production")}, + {class_, QStringLiteral("The class name of the root seeder"), class_up, + DatabaseSeeder}, // Value + {database_, QStringLiteral("The database connection to use " + "(multiple values allowed)"), + database_up}, // Value + {{QChar('f'), + force}, QStringLiteral("Force the operation to run when in production")}, }; } diff --git a/tom/src/tom/commands/database/wipecommand.cpp b/tom/src/tom/commands/database/wipecommand.cpp index a16a4d215..bdfb6d2ab 100644 --- a/tom/src/tom/commands/database/wipecommand.cpp +++ b/tom/src/tom/commands/database/wipecommand.cpp @@ -29,12 +29,14 @@ WipeCommand::WipeCommand(Application &application, QCommandLineParser &parser) QList WipeCommand::optionsSignature() const { return { - {database_, QStringLiteral("The database connection to use " - "(multiple values allowed)"), - database_up}, // Value - {drop_views, QStringLiteral("Drop all tables and views")}, - {drop_types, QStringLiteral("Drop all tables and types (Postgres only)")}, - {force, QStringLiteral("Force the operation to run when in production")}, + {database_, QStringLiteral("The database connection to use " + "(multiple values allowed)"), + database_up}, // Value + {drop_views, QStringLiteral("Drop all tables and views")}, + {drop_types, QStringLiteral("Drop all tables and types (Postgres only)")}, + + {{QChar('f'), + force}, QStringLiteral("Force the operation to run when in production")}, }; } diff --git a/tom/src/tom/commands/make/modelcommand.cpp b/tom/src/tom/commands/make/modelcommand.cpp index 232d143fc..3816f1031 100644 --- a/tom/src/tom/commands/make/modelcommand.cpp +++ b/tom/src/tom/commands/make/modelcommand.cpp @@ -101,10 +101,10 @@ QList ModelCommand::optionsSignature() const { return { // Call other commands - {{QStringLiteral("m"), + {{QChar('m'), migration_}, QStringLiteral("Create a new migration file for the " "model")}, - {{QStringLiteral("s"), + {{QChar('s'), seeder}, QStringLiteral("Create a new seeder for the model")}, // Relationship methods @@ -176,7 +176,7 @@ QList ModelCommand::optionsSignature() const {pivot_model, QStringLiteral("Genarate a custom pivot model class")}, // Others - {{QStringLiteral("o"), + {{QChar('o'), preserve_order}, QStringLiteral("Preserve relations order defined on the " "command-line")}, diff --git a/tom/src/tom/commands/migrations/freshcommand.cpp b/tom/src/tom/commands/migrations/freshcommand.cpp index d62be1de4..38ed1f418 100644 --- a/tom/src/tom/commands/migrations/freshcommand.cpp +++ b/tom/src/tom/commands/migrations/freshcommand.cpp @@ -45,7 +45,8 @@ QList FreshCommand::optionsSignature() const database_up}, // Value {drop_views, QStringLiteral("Drop all tables and views")}, {drop_types, QStringLiteral("Drop all tables and types (Postgres only)")}, - {force, QStringLiteral("Force the operation to run when in production")}, + {{QChar('f'), + force}, QStringLiteral("Force the operation to run when in production")}, // {"schema-path", QStringLiteral("The path to a schema dump file")}, // Value {seed, QStringLiteral("Indicates if the seed task should be re-run")}, {seeder, QStringLiteral("The class name of the root seeder"), seeder_up}, // Value diff --git a/tom/src/tom/commands/migrations/migratecommand.cpp b/tom/src/tom/commands/migrations/migratecommand.cpp index bca222365..f22f92fbe 100644 --- a/tom/src/tom/commands/migrations/migratecommand.cpp +++ b/tom/src/tom/commands/migrations/migratecommand.cpp @@ -39,7 +39,8 @@ QList MigrateCommand::optionsSignature() const {database_, QStringLiteral("The database connection to use " "(multiple values allowed)"), database_up}, // Value - {force, QStringLiteral("Force the operation to run when in production")}, + {{QChar('f'), + force}, QStringLiteral("Force the operation to run when in production")}, {pretend, QStringLiteral("Dump the SQL queries that would be run")}, // {"schema-path", QStringLiteral("The path to a schema dump file")}, // Value {seed, QStringLiteral("Indicates if the seed task should be re-run")}, diff --git a/tom/src/tom/commands/migrations/refreshcommand.cpp b/tom/src/tom/commands/migrations/refreshcommand.cpp index 46f834820..83e65f118 100644 --- a/tom/src/tom/commands/migrations/refreshcommand.cpp +++ b/tom/src/tom/commands/migrations/refreshcommand.cpp @@ -44,7 +44,8 @@ QList RefreshCommand::optionsSignature() const {database_, QStringLiteral("The database connection to use " "(multiple values allowed)"), database_up}, // Value - {force, QStringLiteral("Force the operation to run when in production")}, + {{QChar('f'), + force}, QStringLiteral("Force the operation to run when in production")}, {seed, QStringLiteral("Indicates if the seed task should be re-run")}, {seeder, QStringLiteral("The class name of the root seeder"), seeder_up}, // Value {step_, QStringLiteral("The number of migrations to be reverted & " diff --git a/tom/src/tom/commands/migrations/resetcommand.cpp b/tom/src/tom/commands/migrations/resetcommand.cpp index 1dc2da974..46140b51c 100644 --- a/tom/src/tom/commands/migrations/resetcommand.cpp +++ b/tom/src/tom/commands/migrations/resetcommand.cpp @@ -32,11 +32,12 @@ ResetCommand::ResetCommand( QList ResetCommand::optionsSignature() const { return { - {database_, QStringLiteral("The database connection to use " - "(multiple values allowed)"), - database_up}, // Value - {force, QStringLiteral("Force the operation to run when in production")}, - {pretend, QStringLiteral("Dump the SQL queries that would be run")}, + {database_, QStringLiteral("The database connection to use " + "(multiple values allowed)"), + database_up}, // Value + {{QChar('f'), + force}, QStringLiteral("Force the operation to run when in production")}, + {pretend, QStringLiteral("Dump the SQL queries that would be run")}, }; } diff --git a/tom/src/tom/commands/migrations/rollbackcommand.cpp b/tom/src/tom/commands/migrations/rollbackcommand.cpp index 45bae4d13..bbb1ed671 100644 --- a/tom/src/tom/commands/migrations/rollbackcommand.cpp +++ b/tom/src/tom/commands/migrations/rollbackcommand.cpp @@ -34,12 +34,13 @@ RollbackCommand::RollbackCommand( QList RollbackCommand::optionsSignature() const { return { - {database_, QStringLiteral("The database connection to use " - "(multiple values allowed)"), - database_up}, // Value - {force, QStringLiteral("Force the operation to run when in production")}, - {pretend, QStringLiteral("Dump the SQL queries that would be run")}, - {step_, QStringLiteral("The number of migrations to be reverted"), step_up}, // Value + {database_, QStringLiteral("The database connection to use " + "(multiple values allowed)"), + database_up}, // Value + {{QChar('f'), + force}, QStringLiteral("Force the operation to run when in production")}, + {pretend, QStringLiteral("Dump the SQL queries that would be run")}, + {step_, QStringLiteral("The number of migrations to be reverted"), step_up}, // Value }; } diff --git a/tools/completions/tom.zsh b/tools/completions/tom.zsh index 553de5d1a..83e79689a 100644 --- a/tools/completions/tom.zsh +++ b/tools/completions/tom.zsh @@ -140,7 +140,7 @@ _tom() { integrate) _arguments \ $common_options \ - '1::shell:(bash pwsh zsh)' \ + '1::shell name:(bash pwsh zsh)' \ '--stdout[Print content of the integrate command (instead of writing to disk)]' \ '--path=[The location where the completion file should be created (zsh only)]:folder path:_files -/' ;; @@ -148,14 +148,14 @@ _tom() { list) _arguments \ $common_options \ - '1::namepace:__tom_namespaces' + '1::namepace name:__tom_namespaces' ;; migrate) _arguments \ $common_options \ '--database=[The database connection to use]:connection:__tom_connections' \ - '--force[Force the operation to run when in production]' \ + '(-f --force)'{-f,--force}'[Force the operation to run when in production]' \ '--pretend[Dump the SQL queries that would be run]' \ '--seed[Indicates if the seed task should be re-run]' \ '--step[Force the migrations to be run so they can be rolled back individually]' @@ -167,7 +167,7 @@ _tom() { '(--class)1::class name:__tom_seeders' \ '(1)--class=[The class name of the root seeder \[default: "Seeders::DatabaseSeeder"\]]:class name:__tom_seeders' \ '--database=[The database connection to use]:connection:__tom_connections' \ - '--force[Force the operation to run when in production]' + '(-f --force)'{-f,--force}'[Force the operation to run when in production]' ;; db:wipe) @@ -176,13 +176,13 @@ _tom() { '--database=[The database connection to use]:connection:__tom_connections' \ '--drop-views[Drop all tables and views]' \ '--drop-types[Drop all tables and types (Postgres only)]' \ - '--force[Force the operation to run when in production]' + '(-f --force)'{-f,--force}'[Force the operation to run when in production]' ;; make:migration) _arguments \ $common_options \ - '1::migration:()' \ + '1::migration name:()' \ '--create=[The table to be created]:table name' \ '--table=[The table to migrate]:table name' \ '--path=[The location where the migration file should be created]:folder path:_files -/' \ @@ -195,6 +195,8 @@ _tom() { _arguments \ $common_options \ '1::class name:()' \ + '(-m --migration)'{-m,--migration}'[Create a new migration file for the model]' \ + '(-s --seeder)'{-s,--seeder}'[Create a new seeder for the model]' \ '*--one-to-one=[Create one-to-one relation to the given model]:class name' \ '*--one-to-many=[Create one-to-many relation to the given model]:class name' \ '*--belongs-to=[Create belongs-to relation to the given model]:class name' \ @@ -241,7 +243,7 @@ _tom() { '--database=[The database connection to use]:connection:__tom_connections' \ '--drop-views[Drop all tables and views]' \ '--drop-types[Drop all tables and types (Postgres only)]' \ - '--force[Force the operation to run when in production]' \ + '(-f --force)'{-f,--force}'[Force the operation to run when in production]' \ '--seed[Indicates if the seed task should be re-run]' \ '--seeder=[The class name of the root seeder]:class name:__tom_seeders' \ '--step[Force the migrations to be run so they can be rolled back individually]' @@ -257,7 +259,7 @@ _tom() { _arguments \ $common_options \ '--database=[The database connection to use]:connection:__tom_connections' \ - '--force[Force the operation to run when in production]' \ + '(-f --force)'{-f,--force}'[Force the operation to run when in production]' \ '--seed[Indicates if the seed task should be re-run]' \ '--seeder=[The class name of the root seeder]:class name:__tom_seeders' \ '--step=[The number of migrations to be reverted & re-run]:number' \ @@ -268,7 +270,7 @@ _tom() { _arguments \ $common_options \ '--database=[The database connection to use]:connection:__tom_connections' \ - '--force[Force the operation to run when in production]' \ + '(-f --force)'{-f,--force}'[Force the operation to run when in production]' \ '--pretend[Dump the SQL queries that would be run]' ;; @@ -276,7 +278,7 @@ _tom() { _arguments \ $common_options \ '--database=[The database connection to use]:connection:__tom_connections' \ - '--force[Force the operation to run when in production]' \ + '(-f --force)'{-f,--force}'[Force the operation to run when in production]' \ '--pretend[Dump the SQL queries that would be run]' \ '--step=[The number of migrations to be reverted & re-run]:number' ;;