4848skip_config = (
4949 any (
5050 c in argv
51- for c in ["--skip-config" , "--help" , "-- version" , "completion" ]
51+ for c in ["--skip-config" , "--version" , "completion" ]
5252 )
5353 or TEST_MODE
5454)
@@ -260,7 +260,6 @@ def main(): # pylint: disable=too-many-branches,too-many-statements
260260 plugin_args .remove (parsed .command ) # don't include the plugin name
261261 plugins .invoke (parsed .command , plugin_args , context )
262262 sys .exit (ExitCodes .SUCCESS )
263-
264263 # unknown commands
265264 if (
266265 parsed .command not in cli .ops
@@ -275,14 +274,19 @@ def main(): # pylint: disable=too-many-branches,too-many-statements
275274 if (
276275 parsed .command is not None
277276 and parsed .action is None
278- and parsed .command in cli .ops
279277 ):
280- print_help_command_actions (cli .ops , parsed .command )
281- sys .exit (ExitCodes .SUCCESS )
278+ if parsed .command in cli .ops :
279+ print_help_command_actions (cli .ops , parsed .command )
280+ sys .exit (ExitCodes .SUCCESS )
281+ if parsed .command in cli .config .get_custom_aliases ().keys ():
282+ print_help_command_actions (cli .ops , cli .config .get_custom_aliases ()[parsed .command ])
282283
283284 if parsed .command is not None and parsed .action is not None :
284285 if parsed .help :
285- print_help_action (cli , parsed .command , parsed .action )
286+ if parsed .command in cli .config .get_custom_aliases ().keys ():
287+ print_help_action (cli , cli .config .get_custom_aliases ()[parsed .command ], parsed .action )
288+ else :
289+ print_help_action (cli , parsed .command , parsed .action )
286290 sys .exit (ExitCodes .SUCCESS )
287291
288292 cli .handle_command (parsed .command , parsed .action , args )
0 commit comments