With the following function I want to be able to call it
with nico-usage or with a numeric value to print a different string.
Con this be cleaned up or made easier.
nico-usage ()
{
local docstrg_lang="
{-V, --version}, {-u, --usage}, {-h, --help}
-s SCAL, --scale SCAL"
local docstrg_usage="
nicolaus -s 0.5 -aq 3"
usg=$1
if (( usg == 1 )); then
echo "$docstrg_lang"
elif (( usg == 2 )); then
echo "$docstrg_usage"
else
echo "$docstrg_lang"
fi
}
caseconstruct would probably be more appropriate here.$1be enough or would one also test for$#?$1and then check for the existence of$2in case of-s,--scaleand the undocumented-aq.nico-usage,nico-usage 1,nico-usage 2.