def parse_args():
    parser = ArgumentParser()
    parser.add_argument('filename',
                        metavar='<filename>',
                        help='git-rebase-todo file to edit')
    app.add_common_arguments(parser)
    return parser.parse_args()
Esempio n. 2
0
def parse_args(argv=None):
    """Parse command-line arguments"""
    if argv is None:
        argv = sys.argv[1:]
    parser = argparse.ArgumentParser()
    parser.set_defaults(func=cmd_dag)

    app.add_common_arguments(parser)
    parser.add_argument('-c',
                        '--count',
                        '--max-count',
                        metavar='<count>',
                        type=int,
                        default=1000,
                        help='number of commits to display')
    parser.add_argument('args',
                        nargs='*',
                        metavar='<args>',
                        help='git log arguments')
    args, rest = parser.parse_known_args(args=argv)
    if rest:
        # splice unknown arguments to the beginning ~
        # these are forwarded to git-log(1).
        args.args[:0] = rest
    return args
Esempio n. 3
0
def parse_args(argv=None):
    """Parse command-line arguments"""
    if argv is None:
        argv = sys.argv[1:]
    parser = argparse.ArgumentParser()
    parser.set_defaults(func=cmd_dag)

    app.add_common_arguments(parser)
    parser.add_argument('-c', '--count', '--max-count', metavar='<count>',
                        type=int, default=1000,
                        help='number of commits to display')
    parser.add_argument('args', nargs='*', metavar='<args>',
                        help='git log arguments')
    args, rest = parser.parse_known_args(args=argv)
    if rest:
        # splice unknown arguments to the beginning ~
        # these are forwarded to git-log(1).
        args.args[:0] = rest
    return args
Esempio n. 4
0
def add_command(parent, name, description, func):
    parser = parent.add_parser(str(name), help=description)
    parser.set_defaults(func=func)
    add_common_arguments(parser)
    return parser
Esempio n. 5
0
 def test_add_common_arguments(self):
     # If the function doesn't throw an exception we are happy.
     parser = argparse.ArgumentParser()
     app.add_common_arguments(parser)
Esempio n. 6
0
def add_command(parent, name, description, func):
    parser = parent.add_parser(str(name), help=description)
    parser.set_defaults(func=func)
    add_common_arguments(parser)
    return parser
Esempio n. 7
0
 def test_add_common_arguments(self):
     # If the function doesn't throw an exception we are happy.
     parser = argparse.ArgumentParser()
     app.add_common_arguments(parser)
Esempio n. 8
0
def test_add_common_arguments():
    # If the function doesn't throw an exception we are happy.
    parser = argparse.ArgumentParser()
    assert hasattr(app, 'add_common_arguments')
    app.add_common_arguments(parser)
Esempio n. 9
0
 def test_add_common_arguments(self):
     # If the function doesn't throw an exception we are happy.
     parser = argparse.ArgumentParser()
     self.assertTrue(hasattr(app, 'add_common_arguments'))
     app.add_common_arguments(parser)