我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用oslo_config.cfg.SubCommandOpt()。
def main(): command_opt = cfg.SubCommandOpt('command', title='Command', help=('Available commands'), handler=add_command_parsers) CONF.register_cli_opt(command_opt) CONF(project='craton-api') CONF.command.func()
def main(): command_opt = cfg.SubCommandOpt('command', title='Command', help=_('Available commands'), handler=add_command_parsers) CONF.register_cli_opt(command_opt) service.prepare_service(sys.argv) CONF.command.func()
def main(): command_opt = cfg.SubCommandOpt('command', title='Command', help='Available commands', handler=add_command_parsers) CONF.register_cli_opt(command_opt) CONF(project='zun') CONF.command.func()
def main(): command = cfg.SubCommandOpt('command', title='Command', help='Mixmatch management commands.', handler=register_parsers) CONF.register_cli_opt(command) config.load_from_file() CONF.command.func()