Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wwerner/bashplate
Bashplate generates bash script boilerplate code for option parsing and validation
https://github.com/wwerner/bashplate
bash generator getopt option-parsing
Last synced: about 8 hours ago
JSON representation
Bashplate generates bash script boilerplate code for option parsing and validation
- Host: GitHub
- URL: https://github.com/wwerner/bashplate
- Owner: wwerner
- License: mit
- Created: 2018-10-21T00:31:41.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T10:11:35.000Z (2 months ago)
- Last Synced: 2024-09-10T11:38:32.292Z (2 months ago)
- Topics: bash, generator, getopt, option-parsing
- Language: TypeScript
- Homepage: https://bashplate.wolfgang-werner.net
- Size: 3.54 MB
- Stars: 16
- Watchers: 1
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![setup automated](https://img.shields.io/badge/Gitpod-ready_to_code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
# Bashplate
Bashplate generates bash boilerplate code for option parsing and validation.
Currently deployed here: https://bashplate.wolfgang-werner.net
Why? Each time (long enough to forget all the details after writing the last one) I need to write a shell script:
* 🧐 "I want this to be reuseable, so I'll use proper options & help messages"
* 🤔 "Hmmm, was it getopt or getopts? Which was the GNU and which the POSIX one? Shouldn't I use argbash?"
* 😤 "So how does the option spec need to look like? Why is that colon at the start again? Does the following option take an argument?" and so on.
* 😩 "How to I test if an argument was set? Reliably and portably?"Now, I either:
* Copy an old script and fiddle around in it - bad, since there is stuff to remove, I could break things and I still need to think
* Read up on option parsing - bad, as it takes time and I have to decide between getopt, getopts and argbash
* Just skip parameterizing the script and hard code everything - bad, obviouslySo basically, I try to hack myself into writing better scripts.
If you can relate, give it a spin.
## Requirements
* POSIX compliance flavor, as I want to run in stripped down Docker containers
* GNU flavor with long opts support, as I like short opts for one offs when typing, long opts in scripts for readability.
* Minimum / No dependencies
* Easy to put on the web, so I cannot lose it & don't have to install anything.## Development
Contributions welcome.
* `yarn install` - Project setup
* `yarn dev` - Compiles and hot-reloads for development
* `yarn build` - Compiles and minifies for production
* `yarn lint` - Lints code style issues (& fixes them where possible)Pushing to master deploys to https://bashplate.wolfgang-werner.net and https://bashplate.now.sh (until vercel decides to turn off now.sh).