8000 print grouped common option help in subcommands by reidpr · Pull Request #1394 · hpc/charliecloud · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

print grouped common option help in subcommands #1394

Merged
merged 2 commits into from
Jul 7, 2022
Merged

Conversation

reidpr
Copy link
Collaborator
@reidpr reidpr commented Jun 27, 2022

Closes #1372.

This works around an argparse bug by changing our approach to subcommand help. Specifically, this PR adds help for common options in the help for each subcommand, though segregated into groups. The bug was triggered by suppressing help for the common options.

I don't love it. The usage string is too long and messy. However, I don't have good ideas about a different workaround.

@reidpr reidpr force-pushed the context-assert_1372 branch from 935d806 to 8c535bb Compare June 27, 2022 23:24
@reidpr reidpr requested a review from j-ogas July 5, 2022 22:12
Copy link
Contributor
@j-ogas j-ogas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it is too long and messy. Do we need to distinguish the common opts by group, e.g., build cache common opts? Feels like one lump of common opts is easier to read.

My next thought was to suppress common opts altogether from sub-command help but it appears that is what caused this issue?

@reidpr
Copy link
Collaborator Author
reidpr commented Jul 6, 2022

Do we need to distinguish the common opts by group, e.g., build cache common opts?

That grouping came "for free" because those three options are mutually exclusive. I don't know how to list them in the same group as the others in the help.

My next thought was to suppress common opts altogether from sub-command help but it appears that is what caused this issue?

Yes, that's what we used to do, but it triggers the argparse bug.

@reidpr reidpr merged commit 6cfd85d into master Jul 7, 2022
@reidpr reidpr deleted the context-assert_1372 branch July 7, 2022 19:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ch-image: build: assertion error when no context directory is provided
2 participants
0