From 9b18b3d79e93b2b0aef84e102c0f39962b7e9801 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 13 Sep 2011 21:35:57 +0200 Subject: [PATCH] update manpage and support commands title Signed-off-by: Nico Schottelius --- bin/cdist | 5 +++-- doc/man/man1/cdist.text | 38 ++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/bin/cdist b/bin/cdist index 5333cb3a..21a35c22 100755 --- a/bin/cdist +++ b/bin/cdist @@ -638,16 +638,17 @@ if __name__ == "__main__": # Main subcommand parser parser['main'] = argparse.ArgumentParser(description='cdist ' + VERSION) - parser['main'].add_argument('-V', '--version', help='Show version', action='version', version='%(prog)s ' + VERSION) - parser['sub'] = parser['main'].add_subparsers() + parser['sub'] = parser['main'].add_subparsers(title="Commands") + # Banner parser['banner'] = parser['sub'].add_parser('banner', add_help=False) parser['banner'].set_defaults(func=banner) + # Config parser['config'] = parser['sub'].add_parser('config', parents=[parser['most']]) parser['config'].add_argument('host', nargs='+', diff --git a/doc/man/man1/cdist.text b/doc/man/man1/cdist.text index f45d4495..7f585953 100644 --- a/doc/man/man1/cdist.text +++ b/doc/man/man1/cdist.text @@ -10,22 +10,34 @@ cdist - Configuration management SYNOPSIS -------- -cdist [-h] [-b] [-c CDIST_HOME] [-d] [-i MANIFEST] [-p] [-s] [-V] [host [host ...]] +cdist [-V|--version] +cdist banner +cdist config [-h] [-d] [-V] [-c CDIST_HOME] [-i MANIFEST] [-p] [-s] host [host ...] + DESCRIPTION ----------- cdist is the frontend executable to the cdist configuration management. +cdist supports different as explained below. The options to the main +program are: + +-V, --version:: + Show version and exit -OPTIONS +BANNER ------- +Displays the cdist banner. + + +CONFIG +------ +Configure a system + -h, --help:: Show the help screen --b, --banner:: - Show cdist banner - -c CDIST_HOME, --cdist-home CDIST_HOME:: Instead of using the parent of the bin directory as cdist home, use the specified directory @@ -42,23 +54,25 @@ OPTIONS -s, --sequential:: Operate on multiple hosts sequentially --V, --version:: - Show version and exit - EXAMPLES -------- -------------------------------------------------------------------------------- # Configure ikq05.ethz.ch with debug enabled -cdist -d ikq05.ethz.ch +cdist config -d ikq05.ethz.ch # Configure hosts in parallel and use a different home directory -cdist -c ~/p/cdist-nutzung -p ikq02.ethz.ch ikq03.ethz.ch ikq04.ethz.ch +cdist config -c ~/p/cdist-nutzung \ + -p ikq02.ethz.ch ikq03.ethz.ch ikq04.ethz.ch -# Does not need a comment, plain works -cdist --banner +# Display banner +cdist banner + +# Show help cdist --help + +# Show Version cdist --version --------------------------------------------------------------------------------