def runParsed(self, cli_obj, name, args):
        if args.alias is None:
            # Show all aliases
            sorted_aliases = sorted(cli_obj.review.commitAliases.iteritems(),
                                    key=lambda x: x[0])
            for (alias, commit) in sorted_aliases:
                cli_obj.output('%s: %s'% (alias, commit))
        elif args.commit is None:
            # Show the specified alias
            try:
                commit = cli_obj.review.commitAliases[args.alias]
                cli_obj.output('%s: %s'% (args.alias, commit))
            except __HOLE__:
                cli_obj.outputError('unknown alias %r' % (args.alias,))
                return 1
        else:
            # Set the specified alias
            try:
                cli_obj.review.setCommitAlias(args.alias, args.commit)
            except git.NoSuchObjectError, ex:
                cli_obj.outputError(ex)
                return 1

        return 0
dataset/ETHPy150Open facebookarchive/git-review/src/gitreview/review/cli_reviewer.py/AliasCommand.runParsed