]> git.armaanb.net Git - charsel.git/blobdiff - charsel
fixed echo flag
[charsel.git] / charsel
diff --git a/charsel b/charsel
index 5249f83db96b0381f9f87c2e49b8ffb074cf80ef..8270ff3ed0546463f220a653305507f846986a3d 100755 (executable)
--- a/charsel
+++ b/charsel
@@ -19,7 +19,9 @@
 
 ########################################################################
 
-VERSION=2.0.4
+VERSION=2.0.7
+
+# Environment variables
 
 # Define argument functions
 function usage() {
@@ -27,6 +29,7 @@ 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
@@ -42,7 +45,6 @@ Exit status:
 
 CHARDIR=$HOME/.cache/charsel
 function list() {
-  echo "The following charfiles are installed:"
   ls $CHARDIR/charfiles
 }
 
@@ -108,7 +110,7 @@ if [ $# -eq 0 ]; then
   usage
   exit 3
 fi
-while getopts ":alchdv" arg
+while getopts ":aLlchdv" arg
 do
   case ${arg} in
     h)
@@ -116,6 +118,11 @@ do
       exit 0
       ;;
     l)
+      echo "The following charfiles are installed:"
+      list
+      exit 0
+      ;;
+    L)
       list
       exit 0
       ;;
@@ -194,7 +201,7 @@ do
   # User input
   read -p "| ${bold}input shortcode: ${normal}  " -N $LENGTH INPUT
 
-  if [[ $INPUT == ";"* ]] # Semicolon exits
+  if [[ $INPUT == ";"* ]] # Semicolon exts
   then
     clear
     exit 0
@@ -216,7 +223,7 @@ do
     fi
 
     # Copy output to clipboard
-    echo $OUTPUT | xclip -selection clipboard
+    echo -n $OUTPUT | xclip -selection clipboard
 
     clear
   fi