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.
This commit is contained in:
parent
0c11309a4d
commit
8683c4d974
4
flash
4
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}<BryanJenks@protonmail.com>${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}<BryanJenks@protonmail.com>${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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue