Skip to content

Commit f44960b

Browse files
finally
1 parent 2f976bc commit f44960b

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

linodecli/help_pages.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,26 +325,24 @@ def _help_group_arguments(
325325
for k, group in sorted(
326326
path_to_args.items(), key=lambda a: (len(a[0]), a[0], len(a[1]))
327327
):
328-
329-
if len(group) > 1:
328+
if len(k) > 0 and len(group) > 1:
329+
# This is a named subgroup
330330
groups.append(
331331
# Args should be ordered by least depth -> required -> path
332332
sorted(group, key=lambda v: (v.depth, not v.required, v.path)),
333333
)
334334
continue
335335

336-
target_arg = group[0]
337-
338336
# If the group's argument is required,
339-
# add it to the required group
340-
if target_arg.required:
341-
print(target_arg)
342-
group_required.append(target_arg)
343-
continue
337+
# add it to the top-level required group
338+
for arg in group:
339+
if arg.required:
340+
group_required.append(arg)
341+
continue
344342

345-
# Add ungrouped arguments (single value groups) to the
346-
# "ungrouped" group.
347-
ungrouped.append(target_arg)
343+
# Add ungrouped arguments (single value groups) to the
344+
# "ungrouped" group.
345+
ungrouped.append(arg)
348346

349347
result = []
350348

0 commit comments

Comments
 (0)