Además de la respuesta de Jan Marek... He notado que puedes salirte con la tuya:
ls --full or ls --fu
que hará lo mismo que ls --full-time
como él describió. Gracias Stéphane Chazelas. Ahora escribo ls --fu
en todas partes.:)
Каждый раз, когда вы вызываете getopts , он использует $OPTIND;
If the application sets OPTIND to the value 1, a new set of parameters can be used: either the current positional parameters or new arg values. Any other attempt to invoke getopts multiple times in a single shell execution environment with parameters (positional parameters or arg operands) that are not the same in all invocations, or with an OPTIND value modified to be a value other than 1, produces unspecified results.
(курсив мой ). Вам нужно каждый раз сбрасывать OPTIND перед вызовом getopts, возможно здесь:
#...
# parse flags
OPTIND=1
while getopts 't:s:e:h' flag; do
#...