diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-08-20 20:49:19 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-08-20 20:49:19 +0200 |
commit | f762cf6d64823654e5b7c5beaacd232a1282ef38 (patch) | |
tree | 80a93c87bb2a5b26e3d4601db4c30e93d9eaea8e /gitlab/v4/cli.py | |
parent | 59550f27feaf20cfeb65511292906f99f64b6745 (diff) | |
download | gitlab-f762cf6d64823654e5b7c5beaacd232a1282ef38.tar.gz |
[v4] Use - instead of _ in CLI legacy output
This mimics the v3 behavior.
Diffstat (limited to 'gitlab/v4/cli.py')
-rw-r--r-- | gitlab/v4/cli.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index ca5c6b1..c508fc5 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -269,11 +269,11 @@ class LegacyPrinter(object): for k in sorted(d.keys()): v = d[k] if isinstance(v, dict): - print('%s%s:' % (' ' * padding, k)) + print('%s%s:' % (' ' * padding, k.replace('_', '-'))) new_padding = padding + 2 self.display(v, verbose=True, padding=new_padding, obj=v) continue - print('%s%s: %s' % (' ' * padding, k, v)) + print('%s%s: %s' % (' ' * padding, k.replace('_', '-'), v)) if verbose: if isinstance(obj, dict): @@ -289,7 +289,7 @@ class LegacyPrinter(object): else: id = getattr(obj, obj._id_attr) - print('%s: %s' % (obj._id_attr, id)) + print('%s: %s' % (obj._id_attr.replace('_', '-'), id)) if hasattr(obj, '_short_print_attr'): value = getattr(obj, obj._short_print_attr) print('%s: %s' % (obj._short_print_attr, value)) |