Skip to content

Commit 3851c3f

Browse files
Fix --help for obj commands (#562)
1 parent 76dcce8 commit 3851c3f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

linodecli/plugins/obj/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ def call(
531531
"""
532532
This is called when the plugin is invoked
533533
"""
534+
is_help = "--help" in args or "-h" in args
535+
534536
if not HAS_BOTO:
535537
# we can't do anything - ask for an install
536538
print(
@@ -540,7 +542,7 @@ def call(
540542

541543
sys.exit(2) # requirements not met - we can't go on
542544

543-
clusters = get_available_cluster(context.client)
545+
clusters = get_available_cluster(context.client) if not is_help else None
544546
parser = get_obj_args_parser(clusters)
545547
parsed, args = parser.parse_known_args(args)
546548

@@ -556,7 +558,7 @@ def call(
556558
secret_key = None
557559

558560
# make a client, but only if we weren't printing help
559-
if not "--help" in args:
561+
if not is_help:
560562
access_key, secret_key = get_credentials(context.client)
561563

562564
cluster = parsed.cluster

0 commit comments

Comments
 (0)