diff --git a/flash b/flash index 27248ea..d14623a 100755 --- a/flash +++ b/flash @@ -33,10 +33,15 @@ YELLOW='\033[1;33m' GREEN='\033[0;32m' LGREEN='\033[1;32m' + BLUE='\033[0;34m' + LBLUE='\033[1;34m' + CYAN='\033[0;36m' + LCYAN='\033[1;36m' ORANGE='\033[0;33m' LGREY='\033[0;37m' WHITE='\033[1;37m' NC='\033[0m' # No Color + # ANSI BACKGROUND ESCAPE COLORS WHITEBG='\033[1;47m' # FONT FORMAT EXCAPE CODES @@ -144,6 +149,23 @@ if [ ! -e "$REVIEW_LOG" ]; then touch "$REVIEW_LOG" fi +a_flag='' +b_flag='' + +print_usage() { + printf "\n${LCYAN}fla.sh --- Flash card system by Bryan Jenks${NC} ${LBLUE}${NC}\n\n${YELLOW}${BOLD}Usage:${NC}\n\t${GREEN}flash -h:${NC} Print this help text\n\t${GREEN}flash -i:${NC} Print Information about the flashcard system\n\t${GREEN}flash -v:${NC} Print version Number\n\n" +} + +while getopts 'hiv' flag; do + case "${flag}" in + h) print_usage && exit ;; + i) a_flag='true' ;; + v) b_flag='true' ;; + *) print_usage && exit 1 ;; + esac +done + + # Show pretty FZF preview of decks using BAT DECK="$(find . -maxdepth "$SEARCH_DEPTH" -iname "*.csv" | fzf --preview='bat --theme="Solarized (dark)" --style=numbers --color=always {} | head -500')"