Pushed to
koalephant/shell-script-library
Overview
Atlassian Sourcetree is a free Git and Mercurial client for Windows.
Atlassian Sourcetree is a free Git and Mercurial client for Mac.
Koalephant Shell Script Library
This library provides functions to simplify building portable command-line tools using shell scripts, and tools to assist with building self-contained scripts, and documentation.
Tools
k-script-build: Creates a distributable/installable shell script by converting relative source (.) statements into absolute references or inlining the referenced script. Additionally, acceptsm4-style--defineoptions to replace strings in the source script.k-shell-doc: Reads formatted comments and produces Markdown formatted API documentation. See base.lib.md for an example of the output.k-help2man: Createsmanpages from a script's--helpoutput. Wrapshelp2manto simplify usage.
Modules
base.lib.sh: CLI tool helpers (tool name, options, version), Loggingbool.lib.sh: Boolean value handlingconfig.lib.sh: Config file handlingenvironment.lib.sh: Environment variable handlingfs.lib.sh: File/Directory handlinggpg.lib.sh: GPG key/keyring handlingstring.lib.sh: String handling
Compatibilty
This library aims for POSIX compatibility, with the notable exception of the local keyword, which is supported in all tested shell implementations.
Dependencies
- sed
- gpg/gpg2 (for gpg module)
- cfget (for config module)
Testing
As this project aims for portability, it's intended to be built on multiple POSIX platforms. A Vagrant configuration is included to make building/testing in a Debian Linux VM simpler.