MDL-59574 analytics: Add model listing to enable_model cli script

This commit is contained in:
Ankit Agarwal
2017-11-28 10:52:52 +05:30
parent 556cb98d16
commit 120a795b4e
+8 -1
View File
@@ -31,6 +31,7 @@ $help = "Enables the provided model.
Options:
--modelid Model id
--list List models
--timesplitting Time splitting method full class name
-h, --help Print out this help
@@ -42,6 +43,7 @@ Example:
list($options, $unrecognized) = cli_get_params(
array(
'help' => false,
'list' => false,
'modelid' => false,
'timesplitting' => false
),
@@ -55,7 +57,12 @@ if ($options['help']) {
exit(0);
}
if ($options['modelid'] === false || $options['timesplitting'] === false) {
if ($options['list'] || $options['modelid'] === false) {
\tool_analytics\clihelper::list_models();
exit(0);
}
if ($options['timesplitting'] === false) {
echo $help;
exit(0);
}