3 ms·
In the example I gave I wouldn't write that in a script file, so I would just alter the command itself. If I wanted to parse cli args I would use case on the i
by lbhdc 4y ago
In the example I gave I wouldn't write that in a script file, so I would just alter the command itself.
If I wanted to parse cli args I would use case on the input to mux out the args. I personally prefer writing cli interfaces this way (when using a scripting language).
while test $# -gt 0; do
case "$1" in
-f|--flag) shift; FLAG="$1";;
esac
shift
done