def main(): """Launcher for the CLI functions.""" add_meta_paths() argv = sys.argv[1:] if not argv: return sys.exit(1) for name in ["checkout", "create", "delete"]: if argv[0] == name: return globals()[name](argv[1:]) else: sys.exit("rosie.vc: %s: incorrect usage" % argv[0])
def main(): """Implement "rosa svn-pre-commit".""" add_meta_paths() opt_parser = RoseOptionParser() opts, args = opt_parser.parse_args() repos, txn = args report = Reporter(opts.verbosity - opts.quietness) hook = RosieSvnPreCommitHook(report) try: hook(repos, txn) except Exception as exc: report(exc) if opts.debug_mode: traceback.print_exc(exc) sys.exit(1)