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 argument should output version string only #50

Open
mhrono opened this issue Jun 4, 2024 · 0 comments
Open

--version argument should output version string only #50

mhrono opened this issue Jun 4, 2024 · 0 comments

Comments

@mhrono
Copy link

mhrono commented Jun 4, 2024

As of the current version (2.2), running Baseline.sh --version results in the following output:

+/usr/local/Baseline/Baseline.sh:19> [ --version '=' --version ']'
+/usr/local/Baseline/Baseline.sh:20> basename /usr/local/Baseline/Baseline.sh
+/usr/local/Baseline/Baseline.sh:20> echo 'Baseline.sh by Second Son Consulting - v. 2.2'
Baseline.sh by Second Son Consulting - v. 2.2
+/usr/local/Baseline/Baseline.sh:21> exit 0

As part of my dependency automation and local state management efforts, I'd like to be able to easily gather the version of baseline currently installed on a device. The current output adds some complexity to this. In order to get just the script version, something like the following is required: Baseline.sh --version 2>/dev/null | awk '{print $NF}', which then results in simply 2.2 as desired.

The workaround isn't unreasonable, but I'm of the opinion that version arguments for scripts and binaries should be as terse as possible, only returning the relevant version data.

I'm happy to DIY and pop in a PR to resolve this issue if you'd prefer.

Thanks!

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

No branches or pull requests

1 participant