# `gbp.git.args.GitArgs(object)` class documentation

Part of `gbp.git.args` (View In Hierarchy)

Handle arguments to git commands

    >>> GitArgs('-h', '--no-foo').args
    ['-h', '--no-foo']
    >>> GitArgs('-n', 123).args
    ['-n', '123']
    >>> GitArgs().add('--more-foo', '--less-bar').args
    ['--more-foo', '--less-bar']
    >>> GitArgs().add(['--foo', '--bar']).args
    ['--foo', '--bar']
    >>> GitArgs().add_cond(1 > 2, '--opt', '--no-opt').args
    ['--no-opt']
    >>> GitArgs().add_true(True, '--true').args
    ['--true']
    >>> GitArgs().add_false(True, '--true').args
    []
    >>> GitArgs().add_false(False, '--false').args
    ['--false']

Method | __init__ | Undocumented
Method | args | Undocumented
Method | add | Add arguments to argument list
Method | add_true | Add args if condition is `True`
Method | add_false | Add args if condition is `False`
Method | add_cond | Add option opt to alist if condition is `True` else add noopt.

def __init__(self, *args):
Undocumented
@property
def args(self):
Undocumented
def add(self, *args):

Add arguments to argument list

def add_true(self, condition, *args):

Add args if condition is `True`

Parameters | condition | the condition to test (type: `bool`)
| args | arguments to add

def add_false(self, condition, *args):

Add args if condition is `False`

Parameters | condition | the condition to test (type: `bool`)
| args | arguments to add

def add_cond(self, condition, opt, noopt=[]):

Add option opt to alist if condition is `True` else add noopt.

Parameters | condition | condition (type: `bool`)
| opt | option to add if condition is `True` (type: `str` or `list`)
| noopt | option to add if condition is `False` (type: `str` or `list`)