-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add ansible-community version CLI tool #429
Conversation
@felixfontein How is Does this happen through |
@mariolenz yes, the |
This is now being voted on in ansible-community/community-topics#107. If the proposal is accepted, this will get merged by next week Tuesday and will be used for the Ansible 6.0.0b3 release. |
Hmm, I just noticed that there is no 6.0.0b3 release, the release next week is 6.0.0rc1. |
@felixfontein so from the user perspective, I do : And as part of that, I get a new CLI command called Is that correct? From the docs perspective, we need a good place to document this. The rest of the Ansible CLI commands have autogenerated docs here - https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/user_guide/command_line_tools.rst. I'm thinking we add a manual file to that list for |
Yes, that's correct.
Sounds good! Eventually we can also try to auto-generate that page, but as a first step a manually created file sounds good.
I guess we'll have to do the same thing as for the collection-specific dev guides, and the other ansible vs. ansible-core docsite diferences. |
help="show the version of the Ansible community package", | ||
) | ||
args = parser.parse_args() # noqa: F841, pylint: disable=unused-variable | ||
parser.print_help() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this always print help? I mean, if someone runs ansible-communty --version
, why should we print the help message here? There's not much help, anyway, since there's only the --version
at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When --version
is used, the program exists before parser.print_help()
is executed (search for version=
on https://docs.python.org/3/library/argparse.html: This expects a version= keyword argument in the [add_argument()](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument) call, and prints version information and exits when invoked:
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining @felixfontein! LGTM :-)
Is it possible at some point to also add the ansible-core version to the output so a user gets both? Or is that info not available wherever this command runs? Not a holdup for this PR at all, just wanted to ask what's possible for a future enhancement, or if a user will need to type both commands ( |
@samccann yes, that's definitely possible. (It's just that we wanted to keep the first PR simple so we don't spend some weeks discussing how exactly everything is displayed, and by that miss all deadlines ;-) ) |
@felixfontein cool thanks! |
@mariolenz thanks for preparing and suggesting this! |
CC @mariolenz