anvil / bash-argsparse Goto Github PK
View Code? Open in Web Editor NEWAn high level argument parsing library for bash
License: Do What The F*ck You Want To Public License
An high level argument parsing library for bash
License: Do What The F*ck You Want To Public License
I have something like this:
. /argsparse.sh
argsparse_use_option =project: "Path of the project to publish. If empty PWD is assumed"
Notice that --project
is NOT mandatory. And yet, when I run the script without commands it will print the help and exit.
How do I tell argsparse that it's OK if no option was passed?
Hi,
Currently require only support 'AND'
argsparse_use_option option1 "desc option1"
argsparse_use_option option2 "desc option2"
argsparse_use_option option2 "desc option3" require:"option1 option2"
=> option3 requires option1 AND option2
It would be nice to have
=> option3 requires option1 OR option2
Or even
=> option3 requiques (option1 AND option2) OR requires (option4 AND option5)
Hello,
If two options are mutually exclusive (exclude property) and the first one has a default value, the second one is "unavailable", since default always set a value.
Example :
argsparse_use_option option1 "desc option1" value default:toto exclude:option2
argsparse_use_option option2 "desc option2" exclude:option1
Hi,
the acceptable values feature does not work for me.
I am using GNU bash, version 4.4.23(1)-release (x86_64-unknown-linux-gnu)
.
The __argsparse_is_array_declared check never returns true.
Replacing the line with a simple is-set check [[ ! -z ${!array_name+x} ]]
(stackoverflow) however, works for me.
I could create an PR, if you want :)
Thanks
Hello,
First thanks for this great arguments parsing tool.
I'm trying to use it inside function directly as I need to control function usage.
Some exit statement as in usage() function end all
I tried to use a return 1 statement but I have some error because parsing seems to continue and do not stop anymore after using -h argument.
I have errors as :
-bash: --source-path: option is mandatory.
-bash: --destination-path: option is mandatory.
Is there any way to use your bash-argsparse inside functions ?
Thanks in advance for your advices.
Kind regards
Hi,
The master
branch has a patch that started using [[ -v ]]
, which is a bash 4.2 feature:
0b2bbf6
https://github.com/bminor/bash/blob/master/CHANGES#L3642
README states that GNU bash version >= 4.1
is required.
Do you have plans to bump the min. required bash version to 4.2? Or alternatively, can I open a pull request that replaces -v
with something that is 4.1-compatible?
It's totaly minor but the link to your doxygen documentation is broken, there's only a 1.6.1 version on http://argsparse.livna.org
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.