diff options
Diffstat (limited to 'ariketa.sh')
-rw-r--r-- | ariketa.sh | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -27,6 +27,20 @@ _sourced? || { ARIKETA_DIR=$(_ariketa.dir) +# load examples array +source "${ARIKETA_DIR:?}/config/examples.sh" + +# if examples array has no content, bail with USAGE text +(( ${#_examples[@]} )) || { + >&2 printf "** %s\n" \ + "" ""\ + "$(declare -p _examples)"\ + "_examples array needs content -- see 'configuration' below"\ + "" "" + _ariketa.help + return $? +} + # preserve multiline commands as such in history shopt -s lithist @@ -39,8 +53,5 @@ source "${ARIKETA_DIR:?}/lib/functions.sh" # set up bash macros to page through examples source "${ARIKETA_DIR:?}/lib/bindings.sh" -# load examples array -source "${ARIKETA_DIR:?}/config/examples.sh" - # unset example index/directionality markers unset _I _D |