consider stop parsing after hitting first positional parameter
Hi, I've been looking for a parsing library for a script I'm writing that takes a command as an argument. This command can accept its only command line flags . I'm currently using getopt to parse the arguments but I'd like to remove the necessity to pass -- to separate the args of the script.
example usage: ./wrapper.sh -o option1 -o option2 --hi=yes another-command.sh -h
I've been playing with your script a bit and looking at the code and I see it that it continues to parse after the positional parameters have been reached. I recognize that some people may expect this behaviour. I'm wondering if you'd accept a pull request or add a feature to allow changing this behavior? I'm not really sure what the best way to configure that would be. Maybe just a variable set before the parse option.
something like:
CMDARG_STOP_AT_POSITIONAL=1
cmdarg_parse "$@"