Пример #1
0
def run(configbase, options, args):
    status = 0
    progname = ro_utils.progname(args)
    if len(args) < 2:
        print "%s No command given" % (progname)
        print "Enter '%s help' to show a list of commands"
        status = 2
    else:
        status = ro_command.check_command_args(progname, options, args)
    if status != 0:
        return status
    # @@TODO: refactor to use command/usage table in rocommand for dispatch
    if args[1] == "help":
        status = ro_command.help(progname, args)
    elif args[1] == "config":
        status = ro_command.config(progname, configbase, options, args)
    elif args[1] == "create":
        status = ro_command.create(progname, configbase, options, args)
    elif args[1] == "status":
        status = ro_command.status(progname, configbase, options, args)
    elif args[1] == "add":
        status = ro_command.add(progname, configbase, options, args)
    elif args[1] == "remove":
        status = ro_command.remove(progname, configbase, options, args)
    elif args[1] in ["list", "ls"]:
        status = ro_command.list(progname, configbase, options, args)
    elif args[1] in ["annotate", "link"]:
        status = ro_command.annotate(progname, configbase, options, args)
    elif args[1] == "annotations":
        status = ro_command.annotations(progname, configbase, options, args)
    elif args[1] == "evaluate" or args[1] == "eval":
        status = ro_command.evaluate(progname, configbase, options, args)
    elif args[1] == "checkout":
        status = ro_command.checkout(progname, configbase, options, args)
    elif args[1] == "push":
        status = ro_command.push(progname, configbase, options, args)
    elif args[1] == "dump":
        status = ro_command.dump(progname, configbase, options, args)
    elif args[1] == "manifest":
        status = ro_command.manifest(progname, configbase, options, args)
    elif args[1] == "snapshot":
        status = ro_command.snapshot(progname, configbase, options, args)
    elif args[1] == "archive":
        status = ro_command.archive(progname, configbase, options, args)
    elif args[1] == "freeze":
        status = ro_command.freeze(progname, configbase, options, args)
    else:
        print "%s: unrecognized command: %s" % (progname, args[1])
        status = 2
    return status
Пример #2
0
def run(configbase, options, args):
    status = 0
    progname = ro_utils.progname(args)
    if args[1] == "help":
        status = ro_command.help(progname, args)
    elif args[1] == "config":
        status = ro_command.config(progname, configbase, options, args)
    elif args[1] == "create":
        status = ro_command.create(progname, configbase, options, args)
    elif args[1] == "status":
        status = ro_command.status(progname, configbase, options, args)
    elif args[1] == "list" or args[1] == "ls":
        status = ro_command.list(progname, configbase, options, args)
    elif args[1] == "annotate":
        status = ro_command.annotate(progname, configbase, options, args)
    elif args[1] == "annotations":
        status = ro_command.annotations(progname, configbase, options, args)
    else:
        print "%s: unrecognized command: %s"%(progname,args[1])
        status = 2
    return status