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

version, --version, -V, -v weirdness #795

Closed
kalepail opened this issue Jul 21, 2023 · 3 comments · Fixed by #1100
Closed

version, --version, -V, -v weirdness #795

kalepail opened this issue Jul 21, 2023 · 3 comments · Fixed by #1100
Assignees

Comments

@kalepail
Copy link
Contributor

% soroban -V
soroban 0.9.1 (339cc91f6db1752fed4220df2a2fafe499644fbf)
% soroban --version
soroban 0.9.1 (339cc91f6db1752fed4220df2a2fafe499644fbf)
soroban-env 0.0.17 (400d806387140553e4e685d232deb3a807ec0e36)
soroban-env interface version 85899345971
stellar-xdr 0.0.17 (0f16673441898162c9996da6117be2280ef8fd84)

-V vs -v seems like an anti-pattern. If we want to shorten the --verbose command it should be -V and -v should be version and it should always print out all the version not just the soroban cli version.

@willemneal
Copy link
Member

-v is short of --verbose. I think we should get rid of -V. But I think it is strange that --version differs from the subcommand. However, I think is is difficult because the flag is autogenerate by clap and the other requires build time info.

@stellarsaur
Copy link
Contributor

Ideally, we would replace -V with -v and have the behavior of -v be consistent with soroban version and soroban --version.

@stellarsaur stellarsaur moved this from Backlog to Next Sprint Proposal in Platform Scrum Nov 24, 2023
@leighmcculloch
Copy link
Member

leighmcculloch commented Nov 25, 2023

-V vs -v seems like an anti-pattern

This is a common pattern in CLIs. For example, curl, rustc, cargo, and it's the default behavior when using clap CLI framework, which we're using.

I think this issue is pretty low impact. But for the sake of having one way to do version in soroban-cli, I suggest we remove -V and --version so that the only way to get the version info is with the version subcommand. It keeps the behavior consistent with the overall pattern of behavior of the soroban-cli, where commands are designed around a subcommand triggering behavior, and options modifying that behavior. And it keeps it behaving consistently with the command line interfaces of other Stellar software. For example, stellar-core, stellar-xdr, soroban-rpc, and horizon all behave this way.

The change required is minimal:

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

Successfully merging a pull request may close this issue.

4 participants