bids-validator
bids-validator copied to clipboard
do not ANSI color --version, especially if output is not interactive TTY
since I might use it in filename but
and I end up with
$> bvv=$(bids-validator-deno --version | awk '{{print $2;}}'); mkdir derivatives/; bids-validator-deno --json -o derivatives/bids-validator-$bvv.json .
$> ls -l derivatives/
total 84
84 -rw-r--r-- 1 yarick jblab 84372 Oct 1 11:56 'bids-validator-'$'\033''[94m2.1.1'$'\033''[39m.json'
That's supposed to be detected automatically. You can force it with NO_COLOR=1.
Looks like we can use Deno.stdout.isTerminal() to make sure that colors are turned off.
echo 'Deno.stdout.isTerminal()' | deno -q | cat
false
echo 'Deno.stdout.isTerminal()' | deno -q
true
It's silly but using the short form of the flag should produce what you're looking for.
$ ./local-run -V
2.1.1
Version flag is currently handled automatically by the library Cliffy.
ha, cool @rwblair , I will try to remember . Comes a little unexpected since no such difference is noted in
-V, --version - Show the version number for this program.