Skip to content

Commit 5a20efb

Browse files
author
Gauvain Pocentek
committed
allow to use dash (-) instead of underscore (_) in attribute names
1 parent 93d5147 commit 5a20efb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

gitlab

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ def actionHelpList(cls):
5454

5555
detail = ''
5656
if action == 'list':
57-
detail = " ".join(["--%s=ARG" % x for x in cls.requiredListAttrs])
57+
detail = " ".join(["--%s=ARG" % x.replace('_', '-') for x in cls.requiredListAttrs])
5858
elif action in ['get', 'delete']:
5959
detail = "--id=ARG "
60-
detail += " ".join(["--%s=ARG" % x for x in cls.requiredGetAttrs])
60+
detail += " ".join(["--%s=ARG" % x.replace('_', '-') for x in cls.requiredGetAttrs])
6161
elif action == 'create':
62-
detail = " ".join(["--%s=ARG" % x for x in cls.requiredCreateAttrs])
62+
detail = " ".join(["--%s=ARG" % x.replace('_', '-') for x in cls.requiredCreateAttrs])
6363
if detail:
6464
detail += " "
65-
detail += " ".join(["[--%s=ARG]" % x for x in cls.optionalCreateAttrs])
65+
detail += " ".join(["[--%s=ARG]" % x.replace('_', '-') for x in cls.optionalCreateAttrs])
6666
elif action == 'update':
67-
detail = " ".join(["[--%s=ARG]" % x for x in cls.requiredCreateAttrs])
67+
detail = " ".join(["[--%s=ARG]" % x.replace('_', '-') for x in cls.requiredCreateAttrs])
6868
if detail:
6969
detail += " "
70-
detail += " ".join(["[--%s=ARG]" % x for x in cls.optionalCreateAttrs])
70+
detail += " ".join(["[--%s=ARG]" % x.replace('_', '-') for x in cls.optionalCreateAttrs])
7171
l.append("%s %s" % (action, detail))
7272

7373
return (l)
@@ -109,7 +109,7 @@ args = []
109109
d = {}
110110
for arg in sys.argv[1:]:
111111
if arg.startswith('--'):
112-
arg = arg[2:]
112+
arg = arg[2:].replace('-', '_')
113113

114114
if arg == 'help':
115115
usage()

0 commit comments

Comments
 (0)