def main(): parser = get_parser() args = parser.parse_args() if not hasattr(args, 'command'): parser.print_help() else: return run_command(args)
def main(): # stdlib import sys # Special-case the most commonly used commands to make the parser build quickly in these cases. has_args = len(sys.argv) > 1 # First, zato --version if has_args and sys.argv[1] == '--version': # Zato from zato.common.version import get_version sys.stdout.write(get_version() + '\n') sys.exit(0) # Now, zato start ... elif has_args and sys.argv[1] == 'start': parser = command_store.load_start_parser() # All the other commands else: parser = command_store.load_full_parser() # Parse the arguments args = parser.parse_args() # Exit if no known command was found among arguments .. if not hasattr(args, 'command'): parser.print_help() # .. otherwise, run the command now. else: # Zato from zato.cli import run_command return run_command(args)
def main(): return run_command(get_parser().parse_args())
def main(): return run_command(get_parser().parse_args())