On Fri, November 13, 2015 12:56 pm, Greg Wooledge wrote: > On Fri, Nov 13, 2015 at 10:13:15AM -0600, Griff Miller II wrote: > >> % ./myscript -a -b b >> >> >> Note that in the last run, getopts does not detect that nothing was >> passed via -a, even though -a requires it. Instead, it thinks the next >> switch (-b) is the value of -a. Perhaps this was a conscious decision, >> > > Yes, it is. > > > If you want your script to disallow arguments of -a that begin with a > hyphen character, you will have to check for that yourself.
Well, there you go. :) Thanks for replying. I do currently have just such a workaround implemented. Any chance of making this behavior clearer in the man page?