Skip to content

Commit f762cf6

Browse files
author
Gauvain Pocentek
committed
[v4] Use - instead of _ in CLI legacy output
This mimics the v3 behavior.
1 parent 59550f2 commit f762cf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitlab/v4/cli.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ def display_dict(d, padding):
269269
for k in sorted(d.keys()):
270270
v = d[k]
271271
if isinstance(v, dict):
272-
print('%s%s:' % (' ' * padding, k))
272+
print('%s%s:' % (' ' * padding, k.replace('_', '-')))
273273
new_padding = padding + 2
274274
self.display(v, verbose=True, padding=new_padding, obj=v)
275275
continue
276-
print('%s%s: %s' % (' ' * padding, k, v))
276+
print('%s%s: %s' % (' ' * padding, k.replace('_', '-'), v))
277277

278278
if verbose:
279279
if isinstance(obj, dict):
@@ -289,7 +289,7 @@ def display_dict(d, padding):
289289

290290
else:
291291
id = getattr(obj, obj._id_attr)
292-
print('%s: %s' % (obj._id_attr, id))
292+
print('%s: %s' % (obj._id_attr.replace('_', '-'), id))
293293
if hasattr(obj, '_short_print_attr'):
294294
value = getattr(obj, obj._short_print_attr)
295295
print('%s: %s' % (obj._short_print_attr, value))

0 commit comments

Comments
 (0)