Skip to content

Commit e971e38

Browse files
author
Juliya Smith
authored
Fix command name (#26)
1 parent 54b6b0e commit e971e38

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ root = true
66
indent_style = space
77
indent_size = 4
88
insert_final_newline = true
9-
trim_trailing_whitespace = true
9+
trim_trailing_whitespace = false
1010
end_of_line = lf
1111
charset = utf-8
1212

1313
[*.py]
14-
max_line_length = 100
14+
max_line_length = 100

src/code42cli/parser.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ def _add_argument(parser, arg_settings):
9292
def _get_group_help(command):
9393
descriptions = _build_group_command_descriptions(command)
9494
output = []
95-
if not command.name:
95+
name = command.name
96+
if not name:
9697
name = u"code42"
9798
output.append(BANNER)
9899

99-
output.extend([u" \nAvailable commands in <{}>:".format(command.name), descriptions])
100+
output.extend([u" \nAvailable commands in <{}>:".format(name), descriptions])
100101
return "\n".join(output)
101102

102103

103104
def _build_group_command_descriptions(command):
104105
subs = command.subcommands
105-
name = command.name
106106
name_width = len(max([cmd.name for cmd in subs], key=len))
107107
lines = [u" {} - {}".format(cmd.name.ljust(name_width), cmd.description) for cmd in subs]
108108
return u"\n".join(lines)

0 commit comments

Comments
 (0)