add 'info' command to cli#959
Conversation
|
Note: The current implementation does not print the version anymore, when the I also noticed, that invoking One might also want to restrict the valid queries, filtering out the rather unuseful keywords. |
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
The move up and early return skip's the version printing
I recommend reordering the logic
I'm currently not sure on the details and won't be able to try it's on a computer soon due to traveling
|
No worries, take your time. I'm glad you even look at it at all. The move is intentional, because I thought that behavior for In short, the code in this PR has the following intended behavior:
But if you think it would break that much legacy, I'm not married to that. |
|
its not that this breaks legacy, its just that the change would require a major release so i'm under the impression a little extra complexity to have a ls-only would help that |
|
Sorry, not sure what you mean. Do you want me to change |
|
correct i'm also wondering about whether listing files, versions and info should be flags instead of commands (i'm imagining something like |
|
I'm not averse to doing that. One could also think of re-writing the cli in something like click. Would you be averse to that and the extra dependency? |
|
unfortunately not - it can only be a extra dependency , never a mandatory one the argparse setup should get simpler if the new options are enable/disable flags then in a followup a json output style where each parameter can be asked for can be added |
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
sorry this was hanging for a while
looks good 👍
please take a look at the type nitpicks and add a scriv fragment to the changelog
| print("\n".join(data.values())) | ||
|
|
||
|
|
||
| def _print_key_value(data: dict[Any, Any]) -> None: |
Adds an
infocommand to thesetuptools_scmcommand line. This info command can be used to print settings, like so:This is only a proof of concept implementation, I could work on tests, stabilization and a proper implementation if that was desired.
More details and examples: