-
Notifications
You must be signed in to change notification settings - Fork 139
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
available sub-commands are not displayed for pki-server <sub-command> --help #4932
Comments
edewata
added a commit
to edewata/pki
that referenced
this issue
Feb 3, 2025
Previously if a user called pki-server CLI with a wrong subcommand the ArgumentParser would show an auto-generated error message. The message looks significantly different from the help message already defined in print_help(), is not well-formatted, and is not easy to customize. To address the problem the PKIServerCLI.create_parser() has been modified to use remainder instead of subparsers and the create_parser() in the subcommands has been modified to create a regular ArgumentParser object. The pki-server has also been modified to provide a --version to show the version number of the tool. A new CLIException class has been added to distinguish a normal CLI error message (e.g. invalid module) from unexpected exception. Resolves: dogtagpki#4932
edewata
added a commit
to edewata/pki
that referenced
this issue
Feb 3, 2025
Previously if a user called pki-server CLI with a wrong sub-command the ArgumentParser would show an auto-generated error message which looks significantly different from the help message already defined in print_help(). To make it more consistent the PKIServerCLI.create_parser() and execute() have been modified to use remainder instead of subparsers, and the create_parser() in the sub-commands has been modified to create a regular ArgumentParser instead of a sub-parser. The pki-server has also been modified to provide a --version to show the version number of the tool. A new CLIException has been added to distinguish a normal CLI error (which will generate a simple error message such as "Invalid module") from unexpected exception which will generate a full stack trace. Resolves: dogtagpki#4932
edewata
added a commit
to edewata/pki
that referenced
this issue
Feb 3, 2025
Previously if a user called pki-server CLI with a wrong sub-command the ArgumentParser would show an auto-generated error message which looks significantly different from the help message already defined in print_help(). To make it more consistent the PKIServerCLI.create_parser() and execute() have been modified to use remainder instead of subparsers, and the create_parser() in the sub-commands has been modified to create a regular ArgumentParser instead of a sub-parser. The pki-server has also been modified to provide a --version to show the version number of the tool. A new CLIException has been added to distinguish a normal CLI error (which will generate a simple error message such as "Invalid module") from unexpected exception which will generate a full stack trace. Resolves: dogtagpki#4932
edewata
added a commit
to edewata/pki
that referenced
this issue
Feb 3, 2025
Previously if a user called pki-server CLI with a wrong sub-command the ArgumentParser would show an auto-generated error message which looks significantly different from the help message already defined in print_help(). To fix the issue the PKIServerCLI.create_parser() and execute() have been modified to use remainder instead of subparsers, and the create_parser() in the sub-commands has been modified to create a regular ArgumentParser instead of a subparser. Similar changes were made to the CLI base class to fix the help messages for sub-commands (e.g. pki-server ca). The pki-server has also been modified to provide a --version option to show the version number of the tool. A new CLIException has been added to distinguish a normal CLI error (which will generate a simple error message such as "Invalid module") from an unexpected exception which will generate a full stack trace. Resolves: dogtagpki#4932
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary:
When using --help on a pki-server sub-command, the output is not correct and inconsistent.
Build:
OS: fedora-41
Build: dogtag-pki-11.6.0-0.3.alpha3.20250121163346UTC.bb22542e.fc41.x86_64
COPR: @pki/master
Steps to reproduce:
Expected Result:
As was previously possible and is still possible with the pki command, adding a sub-command to the --help should display the options for it:
Actual Result:
For the above example with sub-command
create
, it is currently displayed as this:Some sub-commands (ca, create...etc) display differently (showing a large list of various sub-commands) like this:
The text was updated successfully, but these errors were encountered: