def main(args): show_all_default = config.GITHUB_REPOSITORY_NAME is None parser = ArgumentParser( prog=cmdline.prog(__file__), description='List all assigned issues' if show_all_default else 'List assigned issues for {}/{}'\ .format( config.GITHUB_ORGANIZATION, config.GITHUB_REPOSITORY_NAME) ) parser.add_argument('-l', '--labels', help='include labels in output', default=False, action='store_true') parser.add_argument('-a', '--all', default=show_all_default, action='store_true', help='show all assigned issues [default: True]' if show_all_default else 'show all assigned issues, not just issues for {}/{} [default: False]'\ .format(config.GITHUB_ORGANIZATION, config.GITHUB_REPOSITORY_NAME)) parser.add_argument('-w', '--wide', default=False, action='store_true', help='use the full width of the terminal') parsed_args = parser.parse_args(args) linewidth = config.TTY_COLS if parsed_args.wide else 80 if parsed_args.labels: print_issues_with_labels(parsed_args.all, linewidth=linewidth) else: print_issues(parsed_args.all, linewidth=linewidth) return 0
def main(args): parser = ArgumentParser( prog=cmdline.prog(__file__), description='Switch to repository branch' ) parser.add_argument('issue', help='Issue number or custom branch name') parsed_args = parser.parse_args(args) try: branch(parsed_args.issue) except Exception as e: print(str(e)) return 0
def main(args): assert config.repo is not None, 'This command must be run from within a git repository.' assert config.repo.active_branch != 'master', 'Will not push to remote master; use git.' parser = ArgumentParser( prog=cmdline.prog(__file__), description='Create a remote branch and set current local branch [{}] to track the remote branch.'\ .format(config.repo.active_branch.name) ) parsed_args = parser.parse_args(args) try: push() except Exception as e: print(str(e)) return 0
def main(args): assert config.repo is not None, 'This command must be run from within a git repository.' assert config.repo.active_branch != 'master', 'Cannot create a pull-request from master branch.' parser = ArgumentParser( prog=cmdline.prog(__file__), description='Create a pull request for the current branch [{}]'\ .format(config.repo.active_branch.name) ) parser.add_argument('title', help='Pull Request title') parsed_args = parser.parse_args(args) try: pullrequest(parsed_args.title) except Exception as e: print(str(e)) return 0
def main(args): parser = ArgumentParser( prog=cmdline.prog(__file__), description= 'Quickly create an issue ticket for the specified repository') parser.add_argument('-o', '--org', required=config.GITHUB_ORGANIZATION is None, type=str, default=config.GITHUB_ORGANIZATION, help='[{}]'.format(config.GITHUB_ORGANIZATION) if config.GITHUB_ORGANIZATION is not None else None) parser.add_argument('-r', '--repo', required=config.GITHUB_REPOSITORY_NAME is None, type=str, default=config.GITHUB_REPOSITORY_NAME, help='[{}]'.format(config.GITHUB_REPOSITORY_NAME) if config.GITHUB_REPOSITORY_NAME is not None else None) parser.add_argument('-t', '--title', required=False, type=str, default=None) parser.add_argument( '-a', '--assign', required=False, type=str, default=None, help='To whom this issue will be assigned [default: self]') parser.add_argument('body') parsed_args = parser.parse_args(args) todo(parsed_args.org, parsed_args.repo, parsed_args.title, parsed_args.body, parsed_args.assign) return 0