configs/bin/help.sh

25 lines
412 B
Bash

#! /bin/bash
GIVE_HELP=1
COMMAND="$1"
if [[ -z "$COMMAND" ]]; then
help <<EOF
Gives help on how to use a command.
Usage: $SCRIPT_NAME <command>
Where <command> is one of: $(list-all-actions)
EOF
fi
SCRIPT="$(resolve-action $COMMAND)"
[[ -z "$SCRIPT" ]] && exit 1
HELPFILE="help/$COMMAND.txt"
if [[ ! -f "$HELPFILE" ]]; then
abort-saying "No help available for \"dgl $COMMAND\""
fi
cat "$HELPFILE"