def __init__(self): self.parser = subparsers.add_parser(name = self.name, description = self.description, help = self.help) self.group = self.parser.add_argument_group("{} group".format(self.name), "generic configuration".format(self.name)) self.group.add_argument( "--ls", action='store_true', help="list available {}(s)".format(self.name) ) self.group.add_argument( "--vi", action='store_true', help="view info about current {}".format(self.name) ) self.group.add_argument( "--mk", action='store', help="create a new {} with given name".format(self.name) ) self.group.add_argument( "--rm", action='store', help="remove a {}".format(self.name) ) self.group.add_argument( "--ck", action='store', help="checkout the given {}".format(self.name) ) self.group.add_argument( "--set", nargs='*', help="set current {} config properties".format(self.name) ) ### TODO: add DB support instead of all but keys (which remain file-based) # instantiate a ConfigManager and set 'config' attr to manage this section self.cfgmgr = ConfigManager() self.config = self.cfgmgr.secmgr[self.name]
def __init__(self): self.parser = subparsers.add_parser(name = self.name, description = self.description, help = self.help) self.group = self.parser.add_mutually_exclusive_group() self.group.add_argument( "--ls", action='store_true', help="list available {}(s)".format(self.name) ) self.group.add_argument( "--vi", action='store_true', help="view info about current {}".format(self.name) ) self.group.add_argument( "--mk", action='store', help="create a new {} with given name".format(self.name) ) self.group.add_argument( "--rm", action='store', help="remove a {}".format(self.name) ) self.group.add_argument( "--ck", action='store', help="checkout the given {}".format(self.name) ) self.group.add_argument( "--set", nargs='*', help="set current {} config properties".format(self.name) ) # instantiate a ConfigManager and set 'config' attr to manage this section self.cfgmgr = ConfigManager() self.config = self.cfgmgr.secmgr[self.name]
def __init__(self): self.parser = subparsers.add_parser(name = self.name, description = self.description, help = self.help)