mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-16 15:33:02 +01:00
LScli : add parameters to load class/addon and their CLI commands
This commit is contained in:
parent
f52f81c1d4
commit
72b4c27651
1 changed files with 20 additions and 4 deletions
|
@ -73,10 +73,12 @@ class LScli {
|
||||||
echo "$error\n\n";
|
echo "$error\n\n";
|
||||||
|
|
||||||
echo "Usage : ".basename($argv[0])." [-h] [-qdC] command\n";
|
echo "Usage : ".basename($argv[0])." [-h] [-qdC] command\n";
|
||||||
echo " -h Show this message\n";
|
echo " -h Show this message\n";
|
||||||
echo " -q|--quiet Quiet mode\n";
|
echo " -q|--quiet Quiet mode\n";
|
||||||
echo " -d|--debug Debug mode\n";
|
echo " -d|--debug Debug mode\n";
|
||||||
echo " -C|--console Log on console\n";
|
echo " -C|--console Log on console\n";
|
||||||
|
echo " -L|--load-class Load specific class to permit access to its CLI commands\n";
|
||||||
|
echo " -A|--load-addons Load specific addon to permit access to its CLI commands\n";
|
||||||
echo " command Command to run\n";
|
echo " command Command to run\n";
|
||||||
echo "\n";
|
echo "\n";
|
||||||
echo "Available commands :\n";
|
echo "Available commands :\n";
|
||||||
|
@ -133,6 +135,20 @@ class LScli {
|
||||||
case '--console':
|
case '--console':
|
||||||
LSlog :: logOnConsole();
|
LSlog :: logOnConsole();
|
||||||
break;
|
break;
|
||||||
|
case '-L':
|
||||||
|
case '--load-class':
|
||||||
|
$i++;
|
||||||
|
$class = $argv[$i];
|
||||||
|
if(!LSsession :: loadLSclass($class))
|
||||||
|
self :: usage("Fail to load class '$class'.");
|
||||||
|
break;
|
||||||
|
case '-A':
|
||||||
|
case '--load-addon':
|
||||||
|
$i++;
|
||||||
|
$addon = $argv[$i];
|
||||||
|
if(!LSsession :: loadLSaddon($addon))
|
||||||
|
self :: usage("Fail to load addon '$addon'.");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if ($command)
|
if ($command)
|
||||||
$command_args[] = $argv[$i];
|
$command_args[] = $argv[$i];
|
||||||
|
|
Loading…
Reference in a new issue