HTTPS SSH

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, accepts m4-style --define options 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: Creates man pages from a script's --help output. Wraps help2man to simplify usage.

Modules

  • base.lib.sh: CLI tool helpers (tool name, options, version), Logging
  • bool.lib.sh: Boolean value handling
  • config.lib.sh: Config file handling
  • environment.lib.sh: Environment variable handling
  • fs.lib.sh: File/Directory handling
  • gpg.lib.sh: GPG key/keyring handling
  • string.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.