Add epilog and description for virt-* --help

This commit is contained in:
Cole Robinson 2013-06-30 15:03:53 -04:00
parent 22f9928a54
commit b6fa7d16e5
5 changed files with 19 additions and 9 deletions

View File

@ -134,7 +134,10 @@ def get_force_target(target, design):
def parse_args():
parser = cli.setupParser()
parser = cli.setupParser(
"%prog --original [NAME] ...",
_("Duplicate a virtual machine, changing all unique configuration "
"like MAC address, name, etc. The VM contents are not altered."))
cli.add_connect_option(parser)
geng = OptionGroup(parser, _("General Options"))

View File

@ -43,8 +43,10 @@ def get_default_arch():
def parse_args():
"""Parse and verify command line."""
usage = "%prog [options] inputdir|input.vmx [outputdir|output.xml]"
opts = cli.setupParser(usage)
opts = cli.setupParser(
"%prog [options] inputdir|input.vmx [outputdir|output.xml]",
_("Convert from virtual machine descriptor format to another. The "
"VM contents are not altered."))
cong = OptionGroup(opts, "Conversion Options")
cong.add_option("-i", "--input-format", dest="input_format",

View File

@ -54,8 +54,9 @@ def get_graphics(image, guest, options):
def parse_args():
usage = "%prog [options] image.xml"
parser = cli.setupParser(usage)
parser = cli.setupParser(
"%prog image.xml [OPTIONS]",
_("Create a virtual machine from a virt-image(5) image descriptor."))
cli.add_connect_option(parser)
geng = OptionGroup(parser, _("General Options"))

View File

@ -845,8 +845,9 @@ def xml_to_print(guest, continue_inst, xmlonly, xmlstep, dry):
#######################
def parse_args():
usage = "%prog --name NAME --ram RAM STORAGE INSTALL [options]"
parser = cli.setupParser(usage)
parser = cli.setupParser(
"%prog --name NAME --ram RAM STORAGE INSTALL [options]",
_("Create a new virtual machine from specified install media."))
cli.add_connect_option(parser)
geng = optparse.OptionGroup(parser, _("General Options"))

View File

@ -140,12 +140,15 @@ class VirtHelpFormatter(optparse.IndentedHelpFormatter):
return ret
def setupParser(usage=None):
def setupParser(usage, description):
parse_class = VirtOptionParser
parser = parse_class(usage=usage,
parser = parse_class(usage=usage, description=description,
formatter=VirtHelpFormatter(),
version=cliconfig.__version__)
parser.epilog = _("See man page for examples and full option syntax.")
return parser