class documentation

class GitArgs(object):

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 add Add arguments to argument list
Method add_cond Add option opt to alist if condition is True else add noopt.
Method add_false Add args if condition is False
Method add_true Add args if condition is True
Property args Undocumented
Instance Variable _args Undocumented
def __init__(self, *args):

Undocumented

def add(self, *args):

Add arguments to argument list

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

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

Parameters
condition:boolcondition
opt:str or listoption to add if condition is True
noopt:str or listoption to add if condition is False
def add_false(self, condition, *args):

Add args if condition is False

Parameters
condition:boolthe condition to test
*argsarguments to add
def add_true(self, condition, *args):

Add args if condition is True

Parameters
condition:boolthe condition to test
*argsarguments to add
@property
args =

Undocumented

_args: list =

Undocumented