PM-3047 "Change the help text for many..." SOLVED

> Code Isuue:
  0017679: Change the help text for many "processmaker" commands
> Solution:
  Se cambia el help de mansajes de processmaker por los nuevos mensajes sugeridos.
This commit is contained in:
Luis Fernando Saisa Lopez
2015-07-20 12:02:33 -04:00
parent a5f64108e4
commit 05c535e5ba
8 changed files with 72 additions and 53 deletions

View File

@@ -28,6 +28,8 @@ G::LoadSystem("g");
CLI::taskName('flush-cache');
CLI::taskDescription(<<<EOT
Flush cache of all workspaces of a given workspace
If no workspace is specified, then the cache will be flushed in all available workspaces.
EOT
);

View File

@@ -4,7 +4,7 @@ CLI::taskName("hotfix-install");
CLI::taskDescription(<<<EOT
Install hotfix to system
This command is executed when you want to update certain files, which have improvements or bugs solutions.
This command installs a hotfix, which updates ProcessMaker in order to add improvements or fix bugs.
EOT
);

View File

@@ -31,11 +31,14 @@ CLI::taskName('mafe-translation');
CLI::taskDescription(<<<EOT
Creates labels of mafe for the database
If no workspace is specified, then the translation labels will be created in all available workspaces.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "languaje", "l:","lang=");
CLI::taskOpt("lang", "Specify the language to create the translation labels. If not specified then the language will be 'en' (English) by default.
Ex: -lfr (French)
Ex: --lang=zh-CN (Mainland Chinese)", "lLANG","lang=LANG");
CLI::taskRun('run_create_translation');
function run_create_translation($args, $opts)

View File

@@ -31,6 +31,9 @@ CLI::taskName('plugins-translation-update');
CLI::taskDescription(<<<EOT
Update plugin translations
LANG is the language, such as 'fr' (French) or 'zh-CN' (mainland Chinese).
If the language is not specified, then it is 'en' (English) by default.
EOT
);
CLI::taskArg('plugin', false);
@@ -41,6 +44,9 @@ CLI::taskName('plugins-translation-create');
CLI::taskDescription(<<<EOT
Create .po file for the plugin
LANG is the language, such as 'fr' (French) or 'zh-CN' (mainland Chinese).
If the language is not specified, then it is 'en' (English) by default.
EOT
);
CLI::taskArg('plugin', true);

View File

@@ -29,10 +29,11 @@ CLI::taskName('build-js');
CLI::taskDescription(<<<EOT
Generate Javascript Files
This command should be run after any modification of javascript files in
folder gulliver/js/*.
This command should be run after any modification of JavaScript files in
the gulliver/js/* directory.
EOT
);
CLI::taskOpt("lang", "", "lLANG","lang=LANG");
//CLI::taskOpt("minify", "If the option is enabled, performs the build only with minified files", "min", "buildmin");
CLI::taskRun("minify_javascript");

View File

@@ -31,23 +31,24 @@ G::LoadSystem("dbMaintenance");
G::LoadClass("cli");
CLI::taskName('upgrade');
CLI::taskDescription("Upgrade workspaces.\n\n This command should be run after ProcessMaker files are upgraded so that all workspaces are upgraded to the current version.");
CLI::taskDescription("Upgrade workspaces.\n\n This command should be run after upgrading ProcessMaker to a new version so that all workspaces are also upgraded to the\n new version.");
CLI::taskOpt("buildACV", "If the option is enabled, performs the Build Cache View.", "ACV", "buildACV");
CLI::taskOpt("buildACV", "If this option is enabled, the Cache View is built.", "ACV", "buildACV");
CLI::taskRun("run_upgrade");
/*----------------------------------********---------------------------------*/
CLI::taskName('unify-database');
CLI::taskDescription(<<<EOT
Unify Rbac, Reports and Workflow databases schemas to match the latest version
Unify RBAC, Reports and Workflow database schemas to match the latest version
Specify the workspaces whose databases schemas should be unifyied.
Specify the workspaces whose databases schemas should be unified.
If no workspace is specified, then the database schema will be upgraded or
repaired on all available workspaces.
This command will read the system schema and attempt to modify the workspaces
tables to match this new schema. Use this command to unify databases
schemas or before ProcessMaker has been upgraded, so the database schemas will
changed to match the new ProcessMaker code.
This command will read the system schema and attempt to modify the workspaces'
tables to match this new schema. In version 2.8 and later, it will merge the 3
databases used in previous versions of ProcessMaker into one database. This
command may be used after upgrading from ProcessMaker 2.5 to a later version
of ProcessMaker.
EOT
);
/*----------------------------------********---------------------------------*/

View File

@@ -37,13 +37,12 @@ CLI::taskRun("run_info");
CLI::taskName('workspace-backup');
CLI::taskDescription(<<<EOT
Backup the specified workspace to an archive.
Backup the specified workspace to a file.
BACKUP-FILE is the backup filename. If it contains slashes, it will be
treated as a path and filename, either absolute or relative. Otherwise, it
will be treated as a filename inside the 'shared/backups' directory.
If no BACKUP-FILE is specified, it will use the workspace name as the
filename.
BACKUP-FILE is the backup filename which will be created. If it contains
slashes, it will be treated as a path and filename, either absolute or relative.
Otherwise, it will be treated as a filename inside the "shared/backups" directory.
If no BACKUP-FILE is specified, it will use the workspace name as the filename.
A backup archive will contain all information about the specified workspace
so that it can be restored later. The archive includes a database dump and
@@ -52,12 +51,12 @@ EOT
);
CLI::taskArg('workspace', false);
CLI::taskArg('backup-file', true);
CLI::taskOpt("filesize", "Set the max size of the compressed splitted files, by default the max is 1000 Mb.", "s:","filesize=");
CLI::taskOpt("filesize", "Split the backup file in multiple files which are compressed. The maximum size of these files is set to MAX-SIZE in megabytes. If MAX-SIZE is not set, then it is 1000 megabytes by default. It may be necessary to use this option if using a 32 bit Linux/UNIX system which limits its maximum file size to 2GB. This option does not work on Windows systems.", "sMAX-SIZE","filesize=MAX-SIZE");
CLI::taskRun("run_workspace_backup");
CLI::taskName('workspace-restore');
CLI::taskDescription(<<<EOT
Restore a workspace from a backup.
Restore a workspace from a backup file
BACKUP-FILE is the backup filename. If it contains slashes, it will be
treated as a path and filename, either absolute or relative. Otherwise, it
@@ -70,12 +69,13 @@ EOT
CLI::taskArg('backup-file', false);
CLI::taskArg('workspace', true);
CLI::taskOpt("overwrite", "If a workspace already exists, overwrite it.", "o", "overwrite");
CLI::taskOpt("info", "Only shows information about a backup archive.", "i");
CLI::taskOpt("multiple", "Restore from multiple compresed enumerated files.", "m");
CLI::taskOpt("workspace", "Select which workspace to restore if multiple workspaces are present in the archive.",
"w:", "workspace=");
CLI::taskOpt("lang", "You must specify language on which rebuild of the case cache list builder will be done; if you don't specify this, it will use 'en' by default", "l:","lang=");
CLI::taskOpt("port", "You must specify mysql port.", "p:");
CLI::taskOpt("info", "Show information about backup file, but do not restore any workspaces.", "i");
CLI::taskOpt("multiple", "Restore from multiple compressed backup files which are numbered.", "m");
CLI::taskOpt("workspace", "Specify which workspace to restore if multiple workspaces are present in the backup file.
Ex: -wworkflow.",
"wWORKSPACE", "workspace=WORKSPACE");
CLI::taskOpt("lang", "Specify the language which will be used to rebuild the case cache list. If this option isn't included, then 'en' (English) will be used by default.", "lLANG","lang=LANG");
CLI::taskOpt("port", "Specify the port number used by MySQL. If not specified, then the port 3306 will be used by default.", "pPORT");
CLI::taskRun("run_workspace_restore");
CLI::taskName('cacheview-repair');
@@ -93,21 +93,21 @@ CLI::taskDescription(<<<EOT
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "You must specify language on which rebuild of the case cache list builder will be done; if you don't specify this, it will use 'en' by default", "l:","lang=");
CLI::taskOpt("lang", "Specify the language to rebuild the case cache list. If not specified, then 'en' (English) will be used by default.\n Ex: -lfr (French) Ex: --lang=zh-CN (Mainland Chinese)", "lLANG", "lang=LANG");
CLI::taskRun("run_cacheview_upgrade");
CLI::taskName('database-upgrade');
CLI::taskDescription(<<<EOT
Upgrade or repair the database schema to match the latest version
  Specify the workspaces whose database schema should be upgraded or repaired.
Specify the workspaces whose database schema should be upgraded or repaired.
If no workspace is specified, then the database schema will be upgraded or
repaired on all available workspaces.
  This command will read the system schema and attempt to modify the workspaces
  tables to match this new schema. Use this command to fix corrupted database
This command will read the system schema and attempt to modify the workspaces
tables to match this new schema. Use this command to fix corrupted database
schemas or after ProcessMaker has been upgraded, so the database schemas will
changed to match the new ProcessMaker code.
be changed to match the new ProcessMaker code.
EOT
);
CLI::taskArg('workspace', true, true);
@@ -117,12 +117,13 @@ CLI::taskName('plugins-database-upgrade');
CLI::taskDescription(<<<EOT
Upgrade or repair the database schema for plugins to match the latest version
  Specify the workspaces whose database schema should be upgraded or repaired
Specify the workspaces whose database schema should be upgraded or repaired
for plugins. If no workspace is specified, then the database schema will be
upgraded or repaired on all available workspaces.
  The same as database-upgrade but works with schemas provided by plugins.
  This is useful if there are installed plugins that include database schemas.
This is the same as database-upgrade but it works with schemas provided
by plugins. This is useful if plugins are installed that include
database schemas.
EOT
);
CLI::taskArg('workspace', true, true);
@@ -130,17 +131,17 @@ CLI::taskRun("run_plugins_database_upgrade");
CLI::taskName('workspace-upgrade');
CLI::taskDescription(<<<EOT
Upgrade the workspace(s) specified.
Upgrade the specified workspace(s).
If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified.
This command is a shortcut to execute all upgrade commands for workspaces.
This command is a shortcut to execute all the upgrade commands for workspaces.
Upgrading a workspace will make it correspond to the current version of
ProcessMaker.
Use this command to upgrade workspaces individually, otherwise use the
upgrade command to upgrade the entire system.
'processmaker upgrade' command to upgrade the entire system.
EOT
);
CLI::taskArg('workspace-name', true, true);
@@ -154,7 +155,7 @@ CLI::taskDescription(<<<EOT
than one workspace can be specified.
This command will go through each language installed in ProcessMaker and
update this workspace translations to match the current version of
update the translations for the workspace(s) to match the current version of
ProcessMaker.
EOT
);
@@ -169,16 +170,17 @@ CLI::taskDescription(<<<EOT
EOT
);
//CLI::taskArg('workspace', true);
CLI::taskOpt("workspace", "Select which workspace to migrate the cases folders, if multiple workspaces are present in the server.",
"w:", "workspace=");
CLI::taskOpt("workspace", "Select the workspace whose case folders will be migrated, if multiple workspaces are present in the server.\n Ex: -wworkflow. Ex: --workspace=workflow",
"wWORKSPACE", "workspace=WORKSPACE");
CLI::taskRun("runStructureDirectories");
CLI::taskName("database-generate-self-service-by-value");
CLI::taskDescription(<<<EOT
Generate or upgrade the table "self-service by value".
This command populate the table "self-service by value", this for the cases when
a task it's defined with "Self Service Value Based Assignment" in "Assignment Rules".
This command populates the table "self-service by value" for cases whose
task is defined with "Self Service Value Based Assignment" in "Assignment
Rules".
If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified.
@@ -192,10 +194,10 @@ CLI::taskName("check-workspace-disabled-code");
CLI::taskDescription(<<<EOT
Check disabled code for the specified workspace(s).
This command is for check disabled code for the specified workspace(s).
This command checks the disabled code in the specified workspace(s).
If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified.
If no workspace is specified, the command will be run in all workspaces.
More than one workspace can be specified.
EOT
);
CLI::taskArg("workspace-name", true, true);

View File

@@ -131,16 +131,17 @@ class CLI
{
global $argv;
$scriptName = $argv[0];
if (is_array( $args )) {
if (is_array($args) && count($args) > 0 ) {
$taskName = $args[0];
} else {
$taskName = $args;
}
if (! $taskName) {
echo "usage: $scriptName <task> [options] [args]\n";
echo "Type '$scriptName help <task-name>' for help on a specific task\n";
echo "\nAvailable tasks:\n";
echo "usage: processmaker <task> [options] [args]\n";
echo " If using Linux/UNIX, prepend './' to specify the directory: " . $scriptName . " <task> [options] [args]\n";
echo "Type 'processmaker help <task>' for help on a specific task.";
echo "\n\nAvailable tasks:\n";
$tasks = array ();
ksort( self::$tasks );
foreach (self::$tasks as $name => $data) {
@@ -180,13 +181,16 @@ class CLI
}
$valid_args[] = $arg;
}
$nameHotfixFile = ($taskName == "hotfix-install")? "HOTFIX-FILE" : ""; //lsl
$valid_args = join( " ", $valid_args );
$description = explode( "\n", self::$tasks[$taskName]['description'] );
$taskDescription = trim( array_shift( $description ) );
$description = trim( implode( "\n", $description ) );
$message = <<< EOT
$taskName: {$taskDescription}
Usage: $scriptName $taskName $valid_args
Usage: processmaker $taskName $nameHotfixFile $valid_args
$description