def __init__(self): OptionParser.__init__(self,\ usage="Usage: %s [GLOBAL OPTIONS] [COMMAND] [ARGUMENTS]"\ " [COMMAND OPTIONS]" % versioning.__shortname__) globalgroup = OptionGroup(self, "GLOBAL OPTIONS") #to correct the capitalization on help text: self.option_list[0].help = 'Show this help message and exit.' self.add_option( '-c', '--config', dest='config', help="Use the provided configuration file instead of the default"\ " one.", metavar='FILE' ) config_dir_default = os.path.join(cliutils.get_user_config_dir(),\ '.%s' % versioning.__shortname__) self.add_option( '--cache-dir', dest='config_dir', default=config_dir_default, help="Use the provided directory as the location to cache data"\ " (default location: %s)" % config_dir_default, metavar='PATH' ) globalgroup.add_option( '-v', '--verbose', dest='verbose', action="store_true", help="""Display verbose information.""", default=False ) globalgroup.add_option( '-d', '--debug', dest='debug', action="store_true", help="""Display debug information.""", default=False ) globalgroup.add_option( '--nocache', dest='nocache', action="store_true", help="During execution the application will temporarily store"\ " data only in memory.", default=False ) globalgroup.add_option( '--nologo', dest='nologo', action="store_true", help="""Include to block logo.""", default=False ) self.add_option_group(globalgroup)
def __init__(self): super(RdmcOptionParser, self).__init__("Usage: %s [GLOBAL OPTIONS] [COMMAND] [ARGUMENTS]" \ "[COMMAND OPTIONS]" % versioning.__shortname__) globalgroup = _ArgumentGroup(self, "GLOBAL OPTIONS") self.add_argument('-c', '--config', dest='config', help="Use the provided configuration file instead of the default one.", metavar='FILE') config_dir_default = os.path.join(cliutils.get_user_config_dir(),\ '.%s' % versioning.__shortname__) self.add_argument( '--cache-dir', dest='config_dir', default=config_dir_default, help="Use the provided directory as the location to cache data"\ " (default location: %s)" % config_dir_default, metavar='PATH') self.add_argument( '-v', '--verbose', dest='verbose', action="store_true", help="""Display verbose information.""", default=False) self.add_argument( '-d', '--debug', dest='debug', action="store_true", help="""Display debug information.""", default=False) self.add_argument( '--logdir', dest='logdir', default=None, help="""Use the provided directory as the location for log file.""", metavar='PATH') self.add_argument( '--nocache', dest='nocache', action="store_true", help="During execution the application will temporarily store data only in memory.", default=False) self.add_argument( '--nologo', dest='nologo', action="store_true", help="""Include to block copyright and logo.""", default=False) self.add_argument( '--redfish', dest='is_redfish', action='store_true', help="Use this flag if you wish to to enable "\ "Redfish only compliance. It is enabled by default "\ "in systems with iLO5 and above.", default=False) self.add_argument( '--latestschema', dest='latestschema', action='store_true', help="Optionally use the latest schema instead of the one "\ "requested by the file. Note: May cause errors in some data "\ "retrieval due to difference in schema versions.", default=False) self.add_argument( '--proxy', dest='proxy', default=None, help="""Use the provided proxy for communication.""", metavar='URL') self.add_argument_group(globalgroup)
def __init__(self): super().__init__(usage="%s [GLOBAL OPTIONS] [COMMAND] [COMMAND ARGUMENTS] " \ "[COMMAND OPTIONS]" % versioning.__shortname__, \ description="iLOrest is a command-line interface that allows you " \ "to manage Hewlett Packard Enterprise products that take advantage" \ " of RESTful APIs.\n\nIn order to view or manage a system you must" \ " first login. You can login using the login command or during " \ "execution of any other command.\nFrom here you can run any other " \ "commands. To learn more about specific commands, run iLOrest " \ "COMMAND -h.\nA list of commands with descriptions is available at" \ " the end of this help.", \ epilog="Examples:\n\nThe following is the standard flow of command" \ "s to view system data.\n\tThe first example is each command " \ "run individually: \n\n\tilorest login\n\tilorest select Bios.\n\t" \ "ilorest get\n\n\tThe second is the list of all of the commands " \ "run at once. First locally, then remotely.\n\tilorest get " \ "--select Bios.\n\tilorest get --select Bios. --url <iLO IP> -u" \ " <iLO Username> -p <iLO Password>", \ formatter_class=RawDescriptionHelpFormatter) globalgroup = _ArgumentGroup(self, "GLOBAL OPTIONS") self.add_argument('-c', \ '--config', \ dest='config', \ help="Use the provided configuration file instead of the default one.", \ metavar='FILE') config_dir_default = os.path.join(cliutils.get_user_config_dir(), \ '.%s' % versioning.__shortname__) self.add_argument( '--cache-dir', \ dest='config_dir', \ default=config_dir_default, \ help="Use the provided directory as the location to cache data" \ " (default location: %s)" % config_dir_default, \ metavar='PATH') self.add_argument( '-v', \ '--verbose', \ dest='verbose', \ #nargs='*', #action=_Verbosity, action="count",\ help="Display verbose information (with increasing level). \'-v\': Level 1, " \ "Logging, Stdout, Stderr. \'-vv\': Level 2, Extends Level 1 with slightly " \ "elaborated iLO and HTTP response message. '-vvv': Level3, Extends Level 2 " \ "with message id, validation class, message text with embedded args, and " \ "possible resolution/mitigation for iLO responses. High detailed HTTP responses. " \ "**NOTE 1**: Some responses may only contain limited information from the source." \ "**NOTE 4**: Default level is 0.", \ default=0) self.add_argument( '-d', \ '--debug', \ dest='debug', \ action="store_true", \ help="""Display debug information.""", \ default=False) self.add_argument( '--logdir', \ dest='logdir', \ default=None, \ help="""Use the provided directory as the location for log file.""", \ metavar='PATH') self.add_argument( '--nocache', \ dest='nocache', \ action="store_true", \ help="During execution the application will temporarily store data only in memory.", \ default=False) self.add_argument( '--nologo', \ dest='nologo', \ action="store_true", \ help="""Include to block copyright and logo.""", \ default=False) self.add_argument( '--notoolbar', \ dest='notoolbar', \ action="store_true", \ help="""Block toolbar at the bottom.""", \ default=False) self.add_argument( '--redfish', \ dest='is_redfish', \ action='store_true', \ help="Use this flag if you wish to to enable " \ "Redfish only compliance. It is enabled by default " \ "in systems with iLO5 and above.", \ default=False) self.add_argument( '--latestschema', \ dest='latestschema', \ action='store_true', \ help="Optionally use the latest schema instead of the one " \ "requested by the file. Note: May cause errors in some data " \ "retrieval due to difference in schema versions.", \ default=False) self.add_argument( '--proxy', \ dest='proxy', \ default=None, \ help="""Use the provided proxy for communication.""", \ metavar='URL') self.add_argument( '--redirectconsole', \ dest='redirect', \ help="Optionally include this flag to redirect stdout/stderr console.", \ nargs='?', \ default=None, \ const=True, \ metavar='REDIRECT CONSOLE') self.add_argument_group(globalgroup)
def __init__(self): super(RdmcOptionParser, self).__init__(usage="%s [GLOBAL OPTIONS] [COMMAND] " \ "[COMMAND ARGUMENTS] [COMMAND OPTIONS]" % versioning.__shortname__, description="iLOrest is a command-line interface that allows you "\ "to manage Hewlett Packard Enterprise products that take advantage"\ " of RESTful APIs.\n\nIn order to view or manage a system you must"\ " first login. You can login using the login command or during "\ "execution of any other command.\nFrom here you can run any other "\ "commands. To learn more about specific commands, run iLOrest "\ "COMMAND -h.\nA list of commands with descriptions is available at"\ " the end of this help.", epilog="Examples:\n\nThe following is the standard flow of command"\ "s to view system data.\n\tThe first example is each command "\ "run individually: \n\n\tilorest login\n\tilorest select Bios.\n\t"\ "ilorest get\n\n\tThe second is the list of all of the commands "\ "run at once. First locally, then remotely.\n\tilorest get "\ "--select Bios.\n\tilorest get --select Bios. --url <iLO IP> -u"\ " <iLO Username> -p <iLO Password>",\ formatter_class=RawDescriptionHelpFormatter) globalgroup = _ArgumentGroup(self, "GLOBAL OPTIONS") self.add_argument( '-c', '--config', dest='config', help= "Use the provided configuration file instead of the default one.", metavar='FILE') config_dir_default = os.path.join(cliutils.get_user_config_dir(),\ '.%s' % versioning.__shortname__) self.add_argument( '--cache-dir', dest='config_dir', default=config_dir_default, help="Use the provided directory as the location to cache data"\ " (default location: %s)" % config_dir_default, metavar='PATH') self.add_argument( '-v', '--verbose', dest='verbose', action="count", help="""Display verbose information (with increasing level).\n\t\'-v\': Level 1""" \ """\n\t\'-vv\': Level 2""") self.add_argument('-d', '--debug', dest='debug', action="store_true", help="""Display debug information.""", default=False) self.add_argument( '--logdir', dest='logdir', default=None, help="""Use the provided directory as the location for log file.""", metavar='PATH') self.add_argument( '--nocache', dest='nocache', action="store_true", help= "During execution the application will temporarily store data only in memory.", default=False) self.add_argument('--nologo', dest='nologo', action="store_true", help="""Include to block copyright and logo.""", default=False) self.add_argument( '--redfish', dest='is_redfish', action='store_true', help="Use this flag if you wish to to enable "\ "Redfish only compliance. It is enabled by default "\ "in systems with iLO5 and above.", default=False) self.add_argument( '--latestschema', dest='latestschema', action='store_true', help="Optionally use the latest schema instead of the one "\ "requested by the file. Note: May cause errors in some data "\ "retrieval due to difference in schema versions.", default=False) self.add_argument('--proxy', dest='proxy', default=None, help="""Use the provided proxy for communication.""", metavar='URL') self.add_argument( '--quiet', '--silent', dest='silent', help= "Optionally include this flag to redirect console print statements.", #action=_SilentAction, #type=str, nargs='?', default=None, const=True, metavar='Silent') self.add_argument_group(globalgroup)