2013-11-13 20:07:12 +01:00
|
|
|
<?php
|
2022-06-28 14:46:11 +02:00
|
|
|
|
2018-01-26 15:45:57 +01:00
|
|
|
# $Id$
|
2013-11-13 20:07:12 +01:00
|
|
|
|
2021-03-22 10:28:28 +01:00
|
|
|
class CliHelp extends Shell
|
|
|
|
{
|
2013-11-13 20:07:12 +01:00
|
|
|
public $handler_to_use = "__not_set__";
|
|
|
|
|
2018-01-26 15:45:57 +01:00
|
|
|
/**
|
|
|
|
* Show help for this shell.
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
*/
|
2021-04-13 22:19:16 +02:00
|
|
|
public function execute()
|
|
|
|
{
|
2013-11-13 20:07:12 +01:00
|
|
|
$this->help();
|
|
|
|
}
|
|
|
|
|
2021-04-13 22:19:16 +02:00
|
|
|
public function help()
|
|
|
|
{
|
2022-06-28 14:46:11 +02:00
|
|
|
$handler = new $this->handler_to_use();
|
2013-11-13 20:07:12 +01:00
|
|
|
# TODO: adjust help text according to $handler->taskNames
|
|
|
|
|
|
|
|
$module = preg_replace('/Handler$/', '', $this->handler_to_use);
|
|
|
|
$module = strtolower($module);
|
|
|
|
|
|
|
|
$this->out(
|
2022-07-15 11:29:55 +02:00
|
|
|
"Usage:
|
2013-11-13 20:07:12 +01:00
|
|
|
|
|
|
|
postfixadmin-cli $module <task> [<address>] [--option value]
|
2018-01-26 15:45:57 +01:00
|
|
|
"
|
|
|
|
);
|
|
|
|
/*
|
|
|
|
View $module in interactive mode.
|
2013-11-13 20:07:12 +01:00
|
|
|
|
2018-01-26 15:45:57 +01:00
|
|
|
- or -
|
2013-11-13 20:07:12 +01:00
|
|
|
|
2018-01-26 15:45:57 +01:00
|
|
|
postfixadmin-cli $module view <address>
|
2013-11-13 20:07:12 +01:00
|
|
|
|
2018-01-26 15:45:57 +01:00
|
|
|
View $module <address> in non-interactive mode.
|
|
|
|
"); */
|
2022-06-28 14:46:11 +02:00
|
|
|
|
2013-11-13 20:07:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
$head = "Usage: postfixadmin-cli $module <task> [<address>] [--option value] [--option value]\n";
|
|
|
|
$head .= "-----------------------------------------------\n";
|
|
|
|
$head .= "Parameters:\n\n";
|
|
|
|
|
|
|
|
$commands = array(
|
|
|
|
'task' => "\t<task>\n" .
|
|
|
|
"\t\tAvailable values:\n\n".
|
2018-04-22 18:24:41 +02:00
|
|
|
"\t\t".sprintf("%-20s %s", "view: ", "View an existing $module.")."\n".
|
|
|
|
"\t\t".sprintf("%-20s %s", "add: ", "Add a $module.")."\n".
|
2018-01-26 15:45:57 +01:00
|
|
|
"\t\t".sprintf("%-20s %s", "update: ", "Update a $module.")."\n".
|
|
|
|
"\t\t".sprintf("%-20s %s", "delete: ", "Delete a $module")."\n",
|
|
|
|
'address' => "\t[<address>]\n" .
|
2013-11-13 20:07:12 +01:00
|
|
|
"\t\tA address of recipient.\n",
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach ($commands as $cmd) {
|
|
|
|
$this->out("{$cmd}\n\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|