argbash
bash3boilerplate
Our great sponsors
argbash | bash3boilerplate | |
---|---|---|
13 | 4 | |
1,359 | 2,071 | |
- | - | |
0.0 | 7.1 | |
about 2 months ago | 8 months ago | |
M4 | Shell | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
argbash
-
Is there a recommended alternative to getopts?
Yeah, now that I look at it a bit closer, it is quirky. Not unmanageable, but I think I prefer something like Argparse which generates the parsing code for you using a simpler language.
- Bashkit V1
- BashLib a helpful source file for any script
- Argbash: Bash argument parsing code generator
- GitHub - matejak/argbash: Bash argument parsing code generator
-
Hacker News top posts: Mar 22, 2022
Argbash: Bash argument parsing code generator\ (0 comments)
bash3boilerplate
-
Being a bash developer in the 21st century
I'm a fan of Bash3 Boilerplate (https://github.com/kvz/bash3boilerplate) and use a modified version of it for my shell scripts now. I like the code style and the logging, although I've amended the logging slightly to add a pipe input for long running processes that you want to see the output from before it finishes.
I prefer having a stop-on-unexpected script as it makes errors far more explicit and it's not too onerous to work round the peculiarities of return codes.
Greg's wiki (https://mywiki.wooledge.org/) is my go to resource for looking up snippets and learning to avoid the footguns - that and shellcheck are the key to "robust" bash scripts.
- Bashkit V1
- BashLib a helpful source file for any script
-
How do you add logs in your bash scripts?
Inspired from https://github.com/kvz/bash3boilerplate/blob/master/main.sh
What are some alternatives?
bash-argsparse - An high level argument parsing library for bash
bash-oo-framework - Bash Infinity is a modern standard library / framework / boilerplate for Bash
getoptions - An elegant option/argument parser for shell scripts (full support for bash and all POSIX shells)
awesome-shell - A curated list of awesome command-line frameworks, toolkits, guides and gizmos. Inspired by awesome-php.
docopts - Shell interpreter for docopt, the command-line interface description language.
bashkit - Official bashkit repository
modernish - Modernish is a library for writing robust, portable, readable, and powerful programs for POSIX-based shells and utilities.
basher - A package manager for shell scripts.
oil - Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
awesome-bash - A curated list of delightful Bash scripts and resources.
argparse-bash - Use python's argparse module in shell scripts
bashify - few helper functions in bash ( especially string manipulation functions )