Skip to content
Myr

Handle empty commands list

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Zachery Bir · committed by Zachery Bir · parent 75e8d69 · Browse files · 1 file+9 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−8 removed

  • other:+9 added−8 removed

1 file+9 added−8 removed

modified:click/core.py+9 added-8 removed
1034 unmodified lines
10351036 commands.append((subcommand, cmd))10371038 # allow for 3 times the default spacing1039 if len(commands):1039 limit = formatter.width - 6 - max(len(cmd[0]) for cmd in commands)1040 limit = formatter.width - 6 - max(len(cmd[0]) for cmd in commands)10411041 rows = []1042 for subcommand, cmd in commands:1043 help = cmd.short_help or cmd.help and make_default_short_help(cmd.help, limit)1044 rows.append((subcommand, help or ''))1042 rows = []1043 for subcommand, cmd in commands:1044 help = cmd.short_help or cmd.help and make_default_short_help(cmd.help, limit)1045 rows.append((subcommand, help or ''))10461046 if rows:1047 with formatter.section('Commands'):1048 formatter.write_dl(rows)1047 if rows:1048 with formatter.section('Commands'):1049 formatter.write_dl(rows)10501051 def parse_args(self, ctx, args):1052 if not args and self.no_args_is_help and not ctx.resilient_parsing:1053 echo(ctx.get_help(), color=ctx.color)
773 unmodified lines