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

Update pki-server to use ArgumentParser #4930

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

edewata
Copy link
Contributor

@edewata edewata commented Jan 20, 2025

The PKIServerCLI has been modified to create a main parser using ArgumentParser then create a subparser for each sub-command.

The CLI.create_parser() has been modified to take an optional subparsers object and pass it down to the modules.

The PKICLI, PasswordGenerateCLI, and PKCS12ImportCLI will be updated separately later.

The PKIServerCLI has been modified to create a main parser
using ArgumentParser then create a subparser for each sub-
command.

The CLI.create_parser() has been modified to take an optional
subparsers object and pass it down to the modules.

The PKICLI, PasswordGenerateCLI, and PKCS12ImportCLI will be
updated separately later.
@edewata edewata requested a review from fmarco76 January 20, 2025 18:23
Copy link
Member

@fmarco76 fmarco76 left a comment

Choose a reason for hiding this comment

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

LGTM

The changes are OK but IIUC the command will have the option from the main parser and the option from the subparser. Es.: pki-server -d start -d.
I think this is true also for the current implementation and in my experience with debug option it provide different results if it is before or after the command.
If this is intentional then the help should make more clear the difference. This can be discussed and addressed in future PRs.

@edewata
Copy link
Contributor Author

edewata commented Jan 21, 2025

@fmarco76 Thanks!

For pki-server --debug there's a slight difference. pki-server <command> --debug basically will enable debug for that command, whereas pki-server --debug <command> will enable debug for pki-server itself (which is not much) and the command too, so I think they can just be merged (i.e. it shouldn't matter where the option is specified).

For pki CLI right now there are some options that work differently depending on the location (e.g. pki --output <command> and pki <command> --output) so we might need to rename some options to avoid conflicts. We'll address that in the next PR.

@edewata edewata merged commit bb22542 into dogtagpki:master Jan 21, 2025
165 of 171 checks passed
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.

2 participants