From f2be16621b013d5b4e56b8629798c26f1111055e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 22 Oct 2013 13:53:58 +0000 Subject: [PATCH] Move list documentation to default action unless help supports default --- .../application/clicommands/ListCommand.php | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/modules/monitoring/application/clicommands/ListCommand.php b/modules/monitoring/application/clicommands/ListCommand.php index 5bba2211b..7b42fa4a9 100644 --- a/modules/monitoring/application/clicommands/ListCommand.php +++ b/modules/monitoring/application/clicommands/ListCommand.php @@ -9,33 +9,9 @@ use Icinga\Cli\Command; use Icinga\File\Csv; /** - * List and filter monitored objects + * Icinga monitoring objects * - * This command allows you to search and visualize your monitored objects in - * different ways. - * - * USAGE - * - * icingaweb monitoring list [] [options] - * - * OPTIONS - * - * --verbose Show detailled output - * --showsql Dump generated SQL query (DB backend only) - * - * --format > - * Dump columns in the given format. format allows $column$ - * placeholders, e.g. --format '$host$: $service$' - * - * -- [filter] - * Filter given column by optional filter. Boolean (1/0) columns are true - * if no filter value is given. - * - * EXAMPLES - * - * icingaweb monitoring list --unhandled - * icingaweb monitoring list --host local* --service *disk* - * icingaweb monitoring list --format '$host_name$: $service_description$' + * This module is your interface to the Icinga monitoring application. */ class ListCommand extends Command { @@ -128,6 +104,35 @@ class ListCommand extends Command exit; } + /** + * List and filter monitored objects + * + * This command allows you to search and visualize your monitored objects in + * different ways. + * + * USAGE + * + * icingaweb monitoring list [] [options] + * + * OPTIONS + * + * --verbose Show detailled output + * --showsql Dump generated SQL query (DB backend only) + * + * --format > + * Dump columns in the given format. format allows $column$ + * placeholders, e.g. --format '$host$: $service$' + * + * -- [filter] + * Filter given column by optional filter. Boolean (1/0) columns are + * true if no filter value is given. + * + * EXAMPLES + * + * icingaweb monitoring list --unhandled + * icingaweb monitoring list --host local* --service *disk* + * icingaweb monitoring list --format '$host$: $service$' + */ public function statusAction() { $columns = array( @@ -147,10 +152,10 @@ class ListCommand extends Command ); $query = $this->getQuery('status', $columns) ->order('host_name'); - echo $this->renderQuery($query); + echo $this->renderStatusQuery($query); } - protected function renderQuery($query) + protected function renderStatusQuery($query) { $out = ''; $last_host = null;