Skip to content

Commit 6d92023

Browse files
committed
A check has been added to know if args has an attribute 'callback'.
If args has no attribute callback, the help text should be printed. Because there was a check to:: if args.callback is 'x': It would raise an error before the parser.print_help() was reached.
1 parent f0f7dd4 commit 6d92023

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tmuxp/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,9 @@ def main():
965965
)
966966

967967
try:
968-
if args.callback is command_load:
968+
if not hasattr(args, 'callback'):
969+
parser.print_help()
970+
elif args.callback is command_load:
969971
command_load(args)
970972
elif args.callback is command_convert:
971973
command_convert(args)
@@ -979,7 +981,5 @@ def main():
979981
command_attach_session(args)
980982
elif args.callback is command_kill_session:
981983
command_kill_session(args)
982-
else:
983-
parser.print_help()
984984
except KeyboardInterrupt:
985985
pass

0 commit comments

Comments
 (0)