Skip to content

Commit

Permalink
fix(cli): Rename of Class CommandArgument to Argument
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Mar 18, 2024
1 parent 2c40f1a commit 7f67a0f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions webfiori/framework/cli/commands/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace webfiori\framework\cli\commands;

use webfiori\cli\CLICommand;
use webfiori\cli\CommandArgument;
use webfiori\cli\Argument;
use webfiori\framework\cli\CLIUtils;
use webfiori\framework\cli\helpers\ClassInfoReader;
use webfiori\framework\cli\helpers\CreateBackgroundTask;
Expand All @@ -33,8 +33,8 @@
class CreateCommand extends CLICommand {
public function __construct() {
parent::__construct('create', [
new CommandArgument('--c', 'What will be created. Possible values: table, entity, web-service, job, middleware, command, theme.', true),
new CommandArgument('--table', '', true),
new Argument('--c', 'What will be created. Possible values: table, entity, web-service, job, middleware, command, theme.', true),
new Argument('--table', '', true),
], 'Creates a system entity (middleware, web service, background process ...).');
}
public function createEntityFromQuery(): int {
Expand Down
4 changes: 2 additions & 2 deletions webfiori/framework/cli/commands/ListThemesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace webfiori\framework\cli\commands;

use webfiori\cli\CLICommand;
use webfiori\cli\CommandArgument;
use webfiori\cli\Argument;
use webfiori\framework\ThemeLoader;

/**
Expand All @@ -31,7 +31,7 @@ class ListThemesCommand extends CLICommand {
*/
public function __construct() {
parent::__construct('list-themes', [
new CommandArgument('--theme-name', 'An optional theme name. If provided, only given theme information will be shown.', true)
new Argument('--theme-name', 'An optional theme name. If provided, only given theme information will be shown.', true)
], 'List all registered themes.');
}
/**
Expand Down
16 changes: 8 additions & 8 deletions webfiori/framework/cli/commands/RunSQLQueryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace webfiori\framework\cli\commands;

use webfiori\cli\CLICommand;
use webfiori\cli\CommandArgument;
use webfiori\cli\Argument;
use webfiori\database\Database;
use webfiori\database\DatabaseException;
use webfiori\database\Table;
Expand All @@ -30,13 +30,13 @@
class RunSQLQueryCommand extends CLICommand {
public function __construct() {
parent::__construct('run-query', [
new CommandArgument('--connection', 'Database connection that the query will be executed on.', true),
new CommandArgument('--schema', 'The namespace of a class that extends the class "webfiori\\framework\\DB" which represents database schema.', true),
new CommandArgument('--create', 'This option is used alongside the option --table and --schema. If it is provided, this means initiate the process of creating the database or the Table.', true),
new CommandArgument('--table', 'Table class to run query on.', true),
new CommandArgument('--file', 'The path to SQL file that holds SQL query.', true),
new CommandArgument('--no-confirm', 'If this argument is provided, the query will be executed without confirmation step.', true),
new CommandArgument('--show-sql', 'If this argument is provided, SQL statement will be shown in the console. This option is ignored if option --no-confirm is not provided.', true),
new Argument('--connection', 'Database connection that the query will be executed on.', true),
new Argument('--schema', 'The namespace of a class that extends the class "webfiori\\framework\\DB" which represents database schema.', true),
new Argument('--create', 'This option is used alongside the option --table and --schema. If it is provided, this means initiate the process of creating the database or the Table.', true),
new Argument('--table', 'Table class to run query on.', true),
new Argument('--file', 'The path to SQL file that holds SQL query.', true),
new Argument('--no-confirm', 'If this argument is provided, the query will be executed without confirmation step.', true),
new Argument('--show-sql', 'If this argument is provided, SQL statement will be shown in the console. This option is ignored if option --no-confirm is not provided.', true),
], 'Execute SQL query on specific database.');
}
/**
Expand Down
16 changes: 8 additions & 8 deletions webfiori/framework/cli/commands/SchedulerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace webfiori\framework\cli\commands;

use webfiori\cli\CLICommand;
use webfiori\cli\CommandArgument;
use webfiori\cli\Argument;
use webfiori\framework\scheduler\AbstractTask;
use webfiori\framework\scheduler\TasksManager;
/**
Expand Down Expand Up @@ -39,13 +39,13 @@ class SchedulerCommand extends CLICommand {
*/
public function __construct() {
parent::__construct('scheduler', [
new CommandArgument('p', 'Scheduler password. If it is set, then it must be provided here.', true),
new CommandArgument('--list', 'List all scheduled tasks.', true),
new CommandArgument('--check', 'Run a check against all tasks to check if it is time to execute them or not.', true),
new CommandArgument('--force', 'Force a specific task to execute.', true),
new CommandArgument('--task-name', 'The name of the task that will be forced to execute or to show its arguments.', true),
new CommandArgument('--show-task-args', 'If this one is provided with task name and a task has custom execution args, they will be shown.', true),
new CommandArgument('--show-log', 'If set, execution log will be shown after execution is completed.', true),
new Argument('p', 'Scheduler password. If it is set, then it must be provided here.', true),
new Argument('--list', 'List all scheduled tasks.', true),
new Argument('--check', 'Run a check against all tasks to check if it is time to execute them or not.', true),
new Argument('--force', 'Force a specific task to execute.', true),
new Argument('--task-name', 'The name of the task that will be forced to execute or to show its arguments.', true),
new Argument('--show-task-args', 'If this one is provided with task name and a task has custom execution args, they will be shown.', true),
new Argument('--show-log', 'If set, execution log will be shown after execution is completed.', true),
], 'Run tasks scheduler.');

if (TasksManager::getPassword() != 'NO_PASSWORD') {
Expand Down
4 changes: 2 additions & 2 deletions webfiori/framework/cli/commands/UpdateSettingsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use Throwable;
use webfiori\cli\CLICommand;
use webfiori\cli\CommandArgument;
use webfiori\cli\Argument;
use webfiori\cli\InputValidator;
use webfiori\framework\App;
use webfiori\framework\config\Controller;
Expand All @@ -29,7 +29,7 @@
class UpdateSettingsCommand extends CLICommand {
public function __construct() {
parent::__construct('update-settings', [
new CommandArgument('--w', 'An argument which is used to indicate what will be updated. '
new Argument('--w', 'An argument which is used to indicate what will be updated. '
.'Possible values are: version, app-name, scheduler-pass, page-title, '
.'page-description, primary-lang, title-sep, home-page, theme,'
.'admin-theme.', true),
Expand Down
4 changes: 2 additions & 2 deletions webfiori/framework/cli/commands/UpdateTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace webfiori\framework\cli\commands;

use webfiori\cli\CLICommand;
use webfiori\cli\CommandArgument;
use webfiori\cli\Argument;
use webfiori\framework\cli\CLIUtils;
use webfiori\framework\cli\helpers\CreateTableObj;
use webfiori\framework\cli\helpers\TableObjHelper;
Expand All @@ -26,7 +26,7 @@ class UpdateTableCommand extends CLICommand {
*/
public function __construct() {
parent::__construct('update-table', [
new CommandArgument('--table', 'The namespace of the table class (including namespace).', true),
new Argument('--table', 'The namespace of the table class (including namespace).', true),
], 'Update a database table.');
}
/**
Expand Down

0 comments on commit 7f67a0f

Please sign in to comment.