We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have this code:
while getopts_long ':remoteHost: toDir:' OPTKEY; do case ${OPTKEY} in 'remoteHost') REMOTE_HOST="${OPTARG}" ;; 'toDir') TO_DIR="${OPTARG}" ;; '?') echo "INVALID OPTION -- ${OPTARG}" >&2 exit 1 ;; ':') echo "MISSING ARGUMENT for option -- ${OPTARG}" >&2 exit 1 ;; *) echo "UNIMPLEMENTED OPTION -- ${OPTKEY}" >&2 exit 1 ;; esac done
and I'm invoking my script with arguments: --remoteHost=somehost --toDir=/tmp/foo
--remoteHost=somehost --toDir=/tmp/foo
The result is:
INVALID OPTION -- remoteHost
The result is the same if I use as arguments: --remote-host somehost --to-dir /tmp/foo
--remote-host somehost --to-dir /tmp/foo
How do I specify that both --remoteHost and --toDir are valid long options?
--remoteHost
--toDir
The text was updated successfully, but these errors were encountered:
Hmmm, it seems that it works as long as I have some short options also -- e.g.:
while getopts_long 'r:t: remoteHost: toDir:' OPTKEY; do
I guess the bug is that multiple long options don't work if you define no short options.
Sorry, something went wrong.
This works: while getopts_long ': remoteHost: toDir:' OPTKEY; do
while getopts_long ': remoteHost: toDir:' OPTKEY; do
No branches or pull requests
I have this code:
and I'm invoking my script with arguments:
--remoteHost=somehost --toDir=/tmp/foo
The result is:
The result is the same if I use as arguments:
--remote-host somehost --to-dir /tmp/foo
How do I specify that both
--remoteHost
and--toDir
are valid long options?The text was updated successfully, but these errors were encountered: