--- /dev/null
+_script()
+{
+ _script_commands=$(charsel -L)
+
+ local cur prev
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ COMPREPLY=( $(compgen -W "${_script_commands}" -- ${cur}) )
+
+ return 0
+}
+complete -o nospace -F _script charsel
########################################################################
-VERSION=2.0.4
+VERSION=2.0.5
# Define argument functions
function usage() {
A simple terminal character selector
-h show this message
-l show installed charfiles
+ -L show installed charfiles without the message
-d show readme
-v print version
-c check charfile validity
CHARDIR=$HOME/.cache/charsel
function list() {
- echo "The following charfiles are installed:"
ls $CHARDIR/charfiles
}
usage
exit 3
fi
-while getopts ":alchdv" arg
+while getopts ":aLlchdv" arg
do
case ${arg} in
h)
exit 0
;;
l)
+ echo "The following charfiles are installed:"
+ list
+ exit 0
+ ;;
+ L)
list
exit 0
;;
# User input
read -p "| ${bold}input shortcode: ${normal} " -N $LENGTH INPUT
- if [[ $INPUT == ";"* ]] # Semicolon exits
+ if [[ $INPUT == ";"* ]] # Semicolon exts
then
clear
exit 0