-
Notifications
You must be signed in to change notification settings - Fork 4
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
[docopts alternative] provide name mangled compatible for docopts #7
Comments
Should be fairly easy to implement. However, I have plans to support bash4.2 assoc output like |
Some times ago, I had an interesting discussion with a macOS user using default bash from MacOS X which is bash3.2 because of GPLv3 of bash higher version, and apple not wanting to share their code. As Bash assoc array syntax is a pain. I really understand users still using globals instead. I would discourage you to only support bash assoc syntax. One real advantage to have assoc is that you can extract all parsed argument from docopt syntax from keys of the assoc array, with this ugly syntax: I mainly proposed to support each other mangling scheme to pass our example between both project. I coded a compatible example prototype here. The explanations are in the wiki here. The idea is that without too much care of rewriting all our existing examples, with can switch and compare behavior between the two projects. I just propose a kind of wrapping output, and of course I test the cross project method, which is the most interesting human part. 😉 |
Following docopt/docopts#35 : this is a twin issue with the project docopts - twin docopt/docopts#36
docopts
use can use global vars with or without prefix the names in the option are converted to mangled names (code here) (which is compatible to old python's output, old code here)Current docopt.sh code
docopts README describing the manged argument conversion.
In order to improve compatibility we need to output compatible variables name from
docopt.sh
Usage could be:
compatible Outputs:
The text was updated successfully, but these errors were encountered: