gbp.git.args.GitArgs(object)
class documentationgbp.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 I{args} if I{condition} is C{True} |
Method | add_false | Add I{args} if I{condition} is C{False} |
Method | add_cond | Add option I{opt} to I{alist} if I{condition} is C{True} else add I{noopt}. |
Add I{args} if I{condition} is C{True} @param condition: the condition to test @type condition: C{bool} @param args: arguments to add
Add I{args} if I{condition} is C{False} @param condition: the condition to test @type condition: C{bool} @param args: arguments to add
Add option I{opt} to I{alist} if I{condition} is C{True} else add I{noopt}. @param condition: condition @type condition: C{bool} @param opt: option to add if I{condition} is C{True} @type opt: C{str} or C{list} @param noopt: option to add if I{condition} is C{False} @type noopt: C{str} or C{list}