Improve CLI usage message format
This commit is contained in:
parent
e26da38457
commit
6684efab2f
1 changed files with 3 additions and 3 deletions
|
@ -42,7 +42,7 @@ function usage($error=false) {
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
echo "$error\n\n";
|
echo "$error\n\n";
|
||||||
printf(_("Usage: %s [-h] [-qd] command\n"), $argv[0]);
|
printf(_("Usage: %s [-h] [-qd] command\n"), basename($argv[0]));
|
||||||
echo _(" -h Show this message\n");
|
echo _(" -h Show this message\n");
|
||||||
echo _(" -q / -d Quiet/Debug mode\n");
|
echo _(" -q / -d Quiet/Debug mode\n");
|
||||||
echo _(" --trace Trace mode (the most verbose)\n");
|
echo _(" --trace Trace mode (the most verbose)\n");
|
||||||
|
@ -53,8 +53,8 @@ function usage($error=false) {
|
||||||
foreach ($cli_commands as $command => $info) {
|
foreach ($cli_commands as $command => $info) {
|
||||||
if ($cli_command && $command != $cli_command)
|
if ($cli_command && $command != $cli_command)
|
||||||
continue;
|
continue;
|
||||||
echo " $command: "._($info['short_desc'])."\n";
|
echo " ".str_replace("\n", "\n ", wordwrap("$command : "._($info['short_desc'])))."\n\n";
|
||||||
echo " ".$argv[0]." $command ".($info['usage_args']?_($info['usage_args']):'')."\n";
|
echo " ".basename($argv[0])." $command ".($info['usage_args']?_($info['usage_args']):'')."\n";
|
||||||
if ($info['long_desc']) {
|
if ($info['long_desc']) {
|
||||||
if (is_array($info['long_desc'])) {
|
if (is_array($info['long_desc'])) {
|
||||||
$lines = array();
|
$lines = array();
|
||||||
|
|
Loading…
Reference in a new issue