Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gitlab/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def main():
if args.fields:
fields = [x.strip() for x in args.fields.split(",")]
debug = args.debug
action = args.action
action = args.whaction
what = args.what

args = args.__dict__
Expand All @@ -193,7 +193,7 @@ def main():
"verbose",
"debug",
"what",
"action",
"whaction",
"version",
"output",
):
Expand Down
2 changes: 1 addition & 1 deletion gitlab/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_parse_args(self):
parser = cli._get_parser(gitlab.v4.cli)
args = parser.parse_args(["project", "list"])
self.assertEqual(args.what, "project")
self.assertEqual(args.action, "list")
self.assertEqual(args.whaction, "list")

def test_parser(self):
parser = cli._get_parser(gitlab.v4.cli)
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def extend_parser(parser):
object_group = subparsers.add_parser(arg_name)

object_subparsers = object_group.add_subparsers(
title="action", dest="action", help="Action to execute."
title="action", dest="whaction", help="Action to execute."
)
_populate_sub_parser_by_class(cls, object_subparsers)
object_subparsers.required = True
Expand Down Expand Up @@ -406,7 +406,7 @@ def display_dict(d, padding):
id = getattr(obj, obj._id_attr)
print("%s: %s" % (obj._id_attr.replace("_", "-"), id))
if hasattr(obj, "_short_print_attr"):
value = getattr(obj, obj._short_print_attr)
value = getattr(obj, obj._short_print_attr) or "None"
value = value.replace("\r", "").replace("\n", " ")
# If the attribute is a note (ProjectCommitComment) then we do
# some modifications to fit everything on one line
Expand Down