SecondSonConsulting / Baseline

An MDM agnostic zero touch solution for macOS
MIT License
192 stars 22 forks source link

--version argument should output version string only #50

Open mhrono opened 3 months ago

mhrono commented 3 months ago

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!