We have added a --conformable option which displays the conformable
units in a similar manner to using the "?" interactively. We will not
support "?" in non-interactive units as suggested below.
We also have decided that the suggested multi-conversion behavior is
not useful enough to warrant addition to the core program. A script
can be used to do this, with a pipe for efficiency if you're in a
hurry, so something like this (once the --conformable option is released):
#!/bin/sh
if [ -z "$1" ]
then
echo Must supply argument to convert
exit
fi
for unit in `./units --conformable $1 | cut -f 1 -d ' '`
do
echo "$1"
echo $unit
done | units --terse --verbose
which produces the output below when run on 'coulomb':
coulomb = 1 C
coulomb = 1 CHARGE
coulomb = 1 D_FLUX
coulomb = 2.9979246e+09 Fr
coulomb = 0.1 abC
coulomb = 0.1 abcoul
coulomb = 0.1 abcoulomb
coulomb = 6.2415091e+18 atomiccharge
coulomb = 1 coul
coulomb = 1 coulomb
coulomb = 0.99999991 coulomb90
coulomb = 6.2415091e+18 e
coulomb = 2.9979246e+09 esu
coulomb = 1.036427e-05 faraday
coulomb = 1.0363156e-05 faraday_chem
coulomb = 1.0360343e-05 faraday_phys
coulomb = 2.9979246e+09 franklin
coulomb = 2.9979246e+09 stC
coulomb = 2.9979246e+09 statC
coulomb = 2.9979246e+09 statcoul
coulomb = 2.9979246e+09 statcoulomb
On Sat, Dec 21, 2019 at 04:00:47AM +0800, 積丹尼 Dan Jacobson wrote:
> >>>>> "AM" == Adrian Mariano <[email protected]> writes:
> AM> So basically you're asking for a command line equivalent to the '?'
> interactive command?
>
> Well, please first fix this
> $ units FORCE \?
> Unknown unit '?'
>
> so it works just like
>
> AM> You have: FORCE
> AM> You want: ?
>
> Next, if we gave it
> You have: cm
> You have: 3.75cm
> You have: m
>
> Then the
> You want: ?
> should be enhanced to give different output for each.