diff options
Diffstat (limited to 'gitlab')
| -rwxr-xr-x | gitlab | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -59,8 +59,9 @@ def actionHelpList(cls): detail += " " detail += "--page=ARG --per-page=ARG" elif action in ['get', 'delete']: - detail = "--id=ARG " - detail += " ".join(["--%s=ARG" % x.replace('_', '-') for x in cls.requiredGetAttrs]) + if cls not in [gitlab.CurrentUser]: + detail = "--id=ARG " + detail += " ".join(["--%s=ARG" % x.replace('_', '-') for x in cls.requiredGetAttrs]) elif action == 'create': detail = " ".join(["--%s=ARG" % x.replace('_', '-') for x in cls.requiredCreateAttrs]) if detail: @@ -113,7 +114,7 @@ args = [] d = {} for arg in sys.argv[1:]: if arg.startswith('--'): - arg = arg[2:].replace('-', '_') + arg = arg[2:] if arg == 'help': usage() @@ -122,8 +123,8 @@ for arg in sys.argv[1:]: verbose = True continue - k, v = arg.split('=', 2) - k = k.strip() + k, v = arg.split('=', 1) + k = k.strip().replace('_', '-') v = v.strip() if k == 'gitlab': @@ -219,10 +220,12 @@ elif action == "get": if not cls.canGet: die("%s objects can't be retrieved" % what) - try: - id = d.pop('id') - except: - die("Missing --id argument") + id = None + if cls not in [gitlab.CurrentUser]: + try: + id = d.pop('id') + except: + die("Missing --id argument") try: o = cls(gl, id, **d) |
