From 8683c4d974e9418e4a28c7ce9157ddf2d80524da Mon Sep 17 00:00:00 2001 From: jsnal Date: Fri, 15 May 2020 14:57:20 -0400 Subject: [PATCH] refactor(pull request): update usage and sleep command per pull request Add a list of supported binaries for the `-p` flag and use read instead of sleep when falling back onto the bat. --- flash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flash b/flash index 67506ac..0e7ffbb 100755 --- a/flash +++ b/flash @@ -151,7 +151,7 @@ if [ ! -e "$REVIEW_LOG" ]; then fi print_usage() { - echo -e "\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\t${GREEN}flash -p [BINARY]:${NC} Change the previewer when selecting decks\n" + echo -e "\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\t${GREEN}flash -p [BINARY]:${NC} Change the previewer when selecting decks. Default: bat\n\t\tSupported: bat, cat\n" } print_info() { @@ -213,7 +213,7 @@ while [[ -z $PREVIEWER_PARAMTERS ]]; do case $PREVIEWER in bat) PREVIEWER_PARAMTERS="--theme='Solarized (dark)' --style=numbers --color=always" ;; cat) PREVIEWER_PARAMTERS="--number" ;; - *) echo -e "$PREVIEWER is not a valid previewer. Use 'bat' or 'cat'. Falling back on default..." && sleep 1 && PREVIEWER='bat' ;; + *) echo -e "$PREVIEWER is not a valid previewer. Use 'bat' or 'cat'. Falling back on default..." && read -s -p 'Press [Enter] to continue...' && PREVIEWER='bat' ;; esac done