Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raehik/bashplate
A very simple Bash template/framework intended for shortening simple (<100 lines) or one-time Bash scripts.
https://github.com/raehik/bashplate
Last synced: 11 days ago
JSON representation
A very simple Bash template/framework intended for shortening simple (<100 lines) or one-time Bash scripts.
- Host: GitHub
- URL: https://github.com/raehik/bashplate
- Owner: raehik
- License: mit
- Created: 2016-03-18T11:08:50.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-25T20:58:11.000Z (over 8 years ago)
- Last Synced: 2024-11-13T16:34:29.084Z (2 months ago)
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
bashplate
=========Rationale
---------OK, here's the thing. I don't want to repeat myself in Bash, but I keep using
the same damn functions all the time! There are lots of frameworks on GitHub
which aim to fix this problem, but they have a habit of being absolute monsters
in terms of size -- if I need a script to be over 100 lines I usually move to
Python. So I need some way to stop myself writing/auto-generating the same
generic logging, usage & options code.Features
--------Enter **bashplate** -- a single file you can source to make life easier when
writing shell scripts. It really does hardly anything:* Some logging, error functions
* Usage handling (send to stderr on failure)
* Long options with POSIX correctness (!!!) thanks to `getopts_long`Seriously it's just barely over 50 lines (as of 2016-08-25). Commented fully
etc.Usage
-----* Point `$_BASHPLATE_DIR` to wherever you choose to install bashplate (I use
`~/.local/share/bashplate`).
* Source `$_BASHPLATE_DIR/bashplate.sh`.
* Define `$_usage` as a full usage string (e.g. `Usage: $_FILENAME
[options]`).The `$_FILENAME` variable is provided as the name of the script being called.
License
-------`getopts_long.sh` is provided under the license stated in its file (IANAL but
it's a short MIT license). All other files in this repository are provided under
the MIT license (see `LICENSE`).