Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1616 allow documenting unnamed arguments #1619

Merged
merged 6 commits into from
Jun 24, 2024

Conversation

alnlarsen
Copy link
Collaborator

This adds help output for unnamed arguments. They are currently a bit hard to spot at the end of the current Usage text. See example:

Usage: install [-h] [-v] [-c] [-q] [--log <arg>] [--merge] [--non-interactive] [--os <arg>] [--architecture <arg>] [--dry-run] [-r <arg>] [-f] [-t <arg>] <image>
  <image>             The image to install. Supported formats:
                      A string describing the image. Example: 'OpenTAP:9.24,TUI:beta,CSV'
                      A path to a file containing an XML or JSON formatted image specification.
  -h, --help          Write help information.
  -v, --verbose       Show verbose/debug-level log messages.
  -c, --color         Color messages according to their severity.
  -q, --quiet         Quiet console logging.
  --log               Specify log file location. Default is ./SessionLogs.
  --merge             Merge the requested image with the existing installation instead of overwriting it.
  --non-interactive   Never prompt for user input.
  --os                The operating system to resolve packages for.
  --architecture      The architecture to resolve packages for.
  --dry-run           Only print the result, don't install the packages.
  -r, --repository    Repositories to use for resolving the image.
  -f, --force         Try to run in spite of errors.
  -t, --target        Override the location where the command is applied.
                      The default is the OpenTAP installation directory.

When I made image install public, I realized that the <image> argument is impossible to figure out without help, and the only alternative way to document it is with an error message which is not very friendly.

Closes #1616

@alnlarsen alnlarsen force-pushed the 1616-allow-documenting-unnamed-arguments branch from d006579 to 92d707b Compare June 19, 2024 14:27
@alnlarsen alnlarsen force-pushed the 1616-allow-documenting-unnamed-arguments branch from 92d707b to eda4ffe Compare June 19, 2024 14:38
StefanHolst
StefanHolst previously approved these changes Jun 20, 2024
Copy link
Collaborator

@StefanHolst StefanHolst left a comment

Choose a reason for hiding this comment

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

This is beautiful! I have been missing this a bunch of times

@alnlarsen alnlarsen dismissed StefanHolst’s stale review June 20, 2024 08:55

The merge-base changed after approval.

@alnlarsen alnlarsen enabled auto-merge (squash) June 20, 2024 11:13
@alnlarsen alnlarsen disabled auto-merge June 24, 2024 11:53
@alnlarsen alnlarsen merged commit 946b69d into main Jun 24, 2024
36 checks passed
@alnlarsen alnlarsen deleted the 1616-allow-documenting-unnamed-arguments branch June 24, 2024 11:53
Copy link

This change is part of OpenTAP version 9.25.0-beta.18+946b69d5 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: Allow documenting [UnnamedCommandLineArgument]
2 participants