-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
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
Do you have an idea for representing key/value options? #77
Comments
@kendalldita did you read http://docopt.org/ ? Your questions seems not specifically related to You should also paste your code you're trying, in order to complete your question, if related to https://stackoverflow.com/questions/tagged/docopt Here is a sample with your input: #!/usr/bin/env bash
# Usage: xsltproc --param=PARAM INPUT OUTPUT
# xsltproc --lang=LANG INPUT OUTPUT
#
# no PATH changes required if docopts binary is in the PATH already
PATH=..:$PATH
source ../docopts.sh
HELP=$(docopt_get_help_string $0)
version='0.1'
parsed=$(docopts -A myargs -h "$HELP" -V $version : "$@")
#echo "$parsed"
eval "$parsed"
# main code
for a in ${!myargs[@]} ; do
echo "$a = ${myargs[$a]}"
done some use-case:
with string parameter
better would be to let
|
Yes. In general, I use software that tries to conform to standards, and try to find an audience that is also interested in both conforming to standards, and practical usages of those standards, while the vast majority of people only care about what is in front of their face at the moment. Then questions are shunted away to different environments designed to avoid anyone asking questions. Thanks for enduring questions this far. I'll now go get my questions rejected on stack overflow. |
Oh, sorry to read that your question was rejected on stackoverflow. 😒 There's way to ask for help, especially in open source and free software community, you may learn with interacting with friendly or not-so-friendly people. 😉 I posted on stackoverflow yesterday for testing, following our conversation. You should notice as I mentioned about
You should, may be, read more carefully how people get answer for there question. What you could improve on what I saw on the issues we exchanged is:
Yes, this is long and sometime disappointing, sometime very grateful 🤷♀️ |
Java and other software has key/value pair parameters, e.g. the
lang
property:Another example:
The parameter name can be anything. Could something like that be represented in docopt syntax?
The text was updated successfully, but these errors were encountered: