@ -89,6 +89,11 @@ args=()
dataDir="${XDG_DATA_HOME:=$HOME/.local/share}/kb/"
dataDir="${XDG_DATA_HOME:=$HOME/.local/share}/kb/"
sqliteFile=""
sqliteFile=""
editor="${EDITOR:=vim}"
editor="${EDITOR:=vim}"
if type -p bat > /dev/null 2>&1; then
pager="bat"
else
pager="${PAGER:=cat}"
fi
# Check for Dependencies
# Check for Dependencies
# -----------------------------------
# -----------------------------------
@ -373,6 +378,8 @@ usage() {
-h, --help Display this help and exit
-h, --help Display this help and exit
--data <directory> The knowledgebase data dir
--data <directory> The knowledgebase data dir
--sqlite <file> The sqlite file (default to <data>/knowledgebase.sqlite3
--sqlite <file> The sqlite file (default to <data>/knowledgebase.sqlite3
--editor <editor> The editor to use (default $EDITOR or vim)
--pager <editor> The pager to use (default bat or $PAGER or cat)
--nogit Don't run git commands
--nogit Don't run git commands
--version Output version information and exit
--version Output version information and exit
@ -446,6 +453,7 @@ while [[ $1 = -?* ]]; do
--data) dataDir="$2"; shift ;;
--data) dataDir="$2"; shift ;;
--sqlite) sqliteFile="$2"; shift ;;
--sqlite) sqliteFile="$2"; shift ;;
--editor) editor="$2"; shift ;;
--editor) editor="$2"; shift ;;
--pager) pager="$2"; shift ;;
--nogit) dogit=0 ;;
--nogit) dogit=0 ;;
--) shift; break ;;
--) shift; break ;;
*) die "invalid option: '$1'." ;;
*) die "invalid option: '$1'." ;;