示例#1
0
def main():
    options, args = parser.parse_args(sys.argv[1:])
    if options.help and not args:
        args = ['help']
    if not args:
        args = ['help'] # as default
    
    load_all_commands()
    command = args[0].lower()
    if command not in command_dict:
        parser.error("Unknown command: `%s`" % command)
        return
    command = command_dict[command]
    command.run(args[1:])
示例#2
0
def main():
    options, args = parser.parse_args(sys.argv[1:])
    if options.help and not args:
        args = ["help"]
    if not args:
        parser.error('You must give a command (use "pythonbrew help" to see a list of commands)')
        return
    
    load_all_commands()
    command = args[0].lower()
    if command not in command_dict:
        parser.error("Unknown command: `%s`" % command)
        return
    command = command_dict[command]
    command.run(args)
示例#3
0
def main():
    options, args = parser.parse_args(sys.argv[1:])
    if options.help and not args:
        args = ['help']
    if not args:
        args = ['help']  # as default

    init_home()
    load_all_commands()
    command = args[0].lower()
    if command not in command_dict:
        parser.error("Unknown command: `%s`" % command)
        return
    command = command_dict[command]
    command.run(args[1:])
示例#4
0
 def run_command(self, options, args):
     if args:
         command = args[0]
         if command not in command_dict:
             parser.error("Unknown command: `%s`" % command)
             return
         command = command_dict[command]
         command.parser.print_help()
         return
     parser.print_help()
     logger.info("\nCommands available:")
     commands = [command_dict[key] for key in sorted(command_dict.keys())]
     for command in commands:
         logger.info("  %s: %s" % (command.name, command.summary))
     logger.info("\nFurther Instructions:")
     logger.info("  http://github.com/utahta/pythonbrew")
示例#5
0
 def run_command(self, options, args):
     if args:
         command = args[0]
         if command not in command_dict:
             parser.error("Unknown command: `%s`" % command)
             return
         command = command_dict[command]
         command.parser.print_help()
         return
     parser.print_help()
     logger.log("\nCommands available:")
     commands = [command_dict[key] for key in sorted(command_dict.keys())]
     for command in commands:
         logger.log("  %s: %s" % (command.name, command.summary))
     logger.log("\nFurther Instructions:")
     logger.log("  https://github.com/utahta/pythonbrew")