resolves 27
This commit is contained in:
parent
ae3158e30e
commit
f8da7b93df
5
flash
5
flash
|
|
@ -220,6 +220,9 @@ done
|
||||||
# Show pretty FZF preview of decks using $PREVIEWER. Default: BAT
|
# Show pretty FZF preview of decks using $PREVIEWER. Default: BAT
|
||||||
DECK="$(find . -maxdepth "$SEARCH_DEPTH" -iname "*.csv" | fzf --preview="$PREVIEWER $PREVIEWER_PARAMTERS {} | head -500")"
|
DECK="$(find . -maxdepth "$SEARCH_DEPTH" -iname "*.csv" | fzf --preview="$PREVIEWER $PREVIEWER_PARAMTERS {} | head -500")"
|
||||||
|
|
||||||
|
# Get current deck name for display
|
||||||
|
CURRENT_DECK="$(echo "$DECK" | awk -F/ '{print $NF}')"
|
||||||
|
|
||||||
# If no deck is selected in fzf menu
|
# If no deck is selected in fzf menu
|
||||||
# return user to start location
|
# return user to start location
|
||||||
# and exit quietly
|
# and exit quietly
|
||||||
|
|
@ -233,6 +236,7 @@ main(){
|
||||||
read -a q <<< "$(sort "$DECK" -n --field-separator=: --key=4 | head -n "$CARD_POOL_SIZE"| shuf -n 1)"
|
read -a q <<< "$(sort "$DECK" -n --field-separator=: --key=4 | head -n "$CARD_POOL_SIZE"| shuf -n 1)"
|
||||||
clear
|
clear
|
||||||
echo -e "${WHITEBG} Fla.sh - Flash Cards In Your Terminal ${NC}
|
echo -e "${WHITEBG} Fla.sh - Flash Cards In Your Terminal ${NC}
|
||||||
|
${ORANGE}${BOLD} Current Deck:${BOLD}${NC}\t$CURRENT_DECK
|
||||||
${ORANGE}${BOLD}Cards Reviewed:${BOLD}${NC}\t$COUNTER
|
${ORANGE}${BOLD}Cards Reviewed:${BOLD}${NC}\t$COUNTER
|
||||||
\t${ORANGE}${BOLD}High Score:${BOLD}${NC}\t$(cat "$HIGH_SCORE")
|
\t${ORANGE}${BOLD}High Score:${BOLD}${NC}\t$(cat "$HIGH_SCORE")
|
||||||
\t${ORANGE}${BOLD}Avg review:${BOLD}${NC}\t$(awk '{ sum += $7; n++ } END { if (n > 0) print sum / n; }' "$REVIEW_LOG")
|
\t${ORANGE}${BOLD}Avg review:${BOLD}${NC}\t$(awk '{ sum += $7; n++ } END { if (n > 0) print sum / n; }' "$REVIEW_LOG")
|
||||||
|
|
@ -250,6 +254,7 @@ ${LGREY}Press [Enter] to continue...${NC}"
|
||||||
done
|
done
|
||||||
clear
|
clear
|
||||||
echo -e "${WHITEBG} Fla.sh - Flash Cards In Your Terminal ${NC}
|
echo -e "${WHITEBG} Fla.sh - Flash Cards In Your Terminal ${NC}
|
||||||
|
${ORANGE}${BOLD} Current Deck:${BOLD}${NC}\t$CURRENT_DECK
|
||||||
${ORANGE}${BOLD}Cards Reviewed:${BOLD}${NC}\t$COUNTER
|
${ORANGE}${BOLD}Cards Reviewed:${BOLD}${NC}\t$COUNTER
|
||||||
\t${ORANGE}${BOLD}High Score:${BOLD}${NC}\t$(cat "$HIGH_SCORE")
|
\t${ORANGE}${BOLD}High Score:${BOLD}${NC}\t$(cat "$HIGH_SCORE")
|
||||||
\t${ORANGE}${BOLD}Avg review:${BOLD}${NC}\t$(awk '{ sum += $7; n++ } END { if (n > 0) print sum / n; }' "$REVIEW_LOG")
|
\t${ORANGE}${BOLD}Avg review:${BOLD}${NC}\t$(awk '{ sum += $7; n++ } END { if (n > 0) print sum / n; }' "$REVIEW_LOG")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue