Instead of dropping everything starting with -, explicitly remove the boolean flags (that cannot contain a = because of the grep before) from the arguments and then remove all -- at the beginning to not care whether you had --test=a or test=a (or ------test=a :D). Also skip the matching if .argv = ""
Instead of dropping everything starting with
-
, explicitly remove the boolean flags (that cannot contain a=
because of the grep before) from the arguments and then remove all--
at the beginning to not care whether you had--test=a
ortest=a
(or------test=a
:D). Also skip the matching if.argv = ""