Closed xuchunyang closed 7 years ago
Hi,
Thanks for reporting this. I suspect that the problem is indeed the getopt
implementation. Mine's man page says:
The getopt command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/
You might be able to find a compatible implementation in Homebrew, but I know very little about it so I can't offer specific advice there.
I guess a more portable solution would be to use getopts
from Bash instead, but it's not as nice to use; that's why I prefer getopt
. But I didn't realize OS X had a different implementation.
Let me know if you find anything in Homebrew or some other solution. If there's no other way around it, I guess we can use getopts
instead (although no promises about when I will get around to changing it ;) ). I don't think many people use the script, so I guess that's why this wasn't noticed sooner.
Thanks.
Oh, I see. I installed getopt
from util-linux manually then the issue is solved. (I use MacPorts as my package manager, it does provide util-linux but it doesn't install getopt
on purpose, it only installs a small subset of util-linux).
Great! I'll add a note to the readme and a message to the script to try to catch cases like this. Thanks.
For example,
./org-protocol-capture-html.sh --help
doesn't show the help message then quit as I expect. Instead, it runs something likeMy system is macOS, I have tried both bash 3.2.57 and 4.4.12. And according to
man getopt
, thegetopt
I am using is from the BSD. I heard that BSD programs often don't support long options, though I am not sure this is related.Any tips?