diff options
author | George Kraft <george.kraft@calxeda.com> | 2013-04-26 17:24:45 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2013-04-26 17:24:45 -0500 |
commit | ba073042ec5349496492a6429932b5d8e8a2a569 (patch) | |
tree | 179f48737a91f66c47a6d9ec82552ad131023c1a /scripts | |
parent | 39b04723c1e026d65e8478af50efe6107cadfe25 (diff) | |
download | cxmanage-ba073042ec5349496492a6429932b5d8e8a2a569.tar.gz |
CXMAN-187: Add examples to the cxmanage -h usage print
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/cxmanage | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/scripts/cxmanage b/scripts/cxmanage index 737017f..ba36cc0 100755 --- a/scripts/cxmanage +++ b/scripts/cxmanage @@ -52,6 +52,17 @@ PYIPMI_VERSION = '0.7.0' IPMITOOL_VERSION = '1.8.11.0-cx4' +PARSER_EPILOG = """examples: + cxmanage power status 192.168.1.1 # single host + cxmanage power on 192.168.1.1,192.168.1.2 # comma-separated hosts + cxmanage info 192.168.1.1-192.168.1.5 # IP range (5 hosts) + cxmanage -a sensor temp 192.168.1.1 # all nodes on a fabric + cxmanage -a fwupdate package ECX-1000_update.tar.gz 192.168.1.1""" + +FWUPDATE_EPILOG = """examples: + cxmanage -a fwupdate package ECX-1000_update.tar.gz 192.168.1.1""" + + FWUPDATE_IMAGE_TYPES = ['PACKAGE'] + sorted([ 'DEL', 'DEL1', @@ -71,14 +82,14 @@ FWUPDATE_IMAGE_TYPES = ['PACKAGE'] + sorted([ 'DIAG_ELF', ]) -FWUPDATE_EPILOG = """examples: - cxmanage -a fwupdate package ECX-1000_update.tar.gz 192.168.100.100""" def build_parser(): """setup the argparse parser""" parser = argparse.ArgumentParser( - description='Calxeda Server Management Utility') + description='Calxeda Server Management Utility', + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=PARSER_EPILOG) #global arguments parser.add_argument('-V', '--version', action='store_true', @@ -164,8 +175,8 @@ def build_parser(): #fwupdate command fwupdate = subparsers.add_parser('fwupdate', help='update firmware', - epilog=FWUPDATE_EPILOG, - formatter_class=argparse.RawDescriptionHelpFormatter) + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=FWUPDATE_EPILOG) fwupdate.add_argument('image_type', metavar='IMAGE_TYPE', help='image type to use (%s)' % ", ".join(FWUPDATE_IMAGE_TYPES), type=lambda string: string.upper(), @@ -272,7 +283,8 @@ def build_parser(): help='Network interface to check') ipdiscover.set_defaults(func=ipdiscover_command) - parser.add_argument('hostname', help='hostname to target') + parser.add_argument('hostname', + help='nodes to operate on (see examples below)') return parser |