Glassthought Bash Env

Repo location:

git@gitlab.com:vintrin/glassthought-bash-env.git

Installation

Required env variables prior to source:

  • GT_BASH_ENV - Path to the directory of 'glassthought-bash-env'

What to source

source ${GT_BASH_ENV:?}/glassthought-env.sh

Adding new functions

Adding --help support

Add the following at the beginning of your added function.

gt.if_help_display_doc_and_stop "$1"

Which will check if the first argument is --help and display the function's documentation if it is. The documentation is expected to be in ${GT_BASH_ENV:?}/help/<function_name>.md file. It will then stop the script using interrupt.

Here is how it looks in a function:

gt.example_using_help(){
  gt.if_help_display_doc_and_stop "${1}"

  echo "This is the main part of function."
}

Children
  1. Func

Backlinks