]> git.armaanb.net Git - charsel.git/commitdiff
minor behavior change when no arguments are passed
authorArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Mon, 26 Oct 2020 16:27:53 +0000 (12:27 -0400)
committerArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Mon, 26 Oct 2020 16:27:53 +0000 (12:27 -0400)
charsel

diff --git a/charsel b/charsel
index 6fb47d21309070a9936967e617215b7b19c56cb4..d7deba7801b2c9adc87817316c33e8e6b4488244 100755 (executable)
--- a/charsel
+++ b/charsel
@@ -106,10 +106,6 @@ function validity() {
 }
 
 # Look for arguments
-if [ $# -eq 0 ]; then
-  usage
-  exit 3
-fi
 while getopts ":abcdhlLnv" arg
 do
   case ${arg} in
@@ -156,6 +152,11 @@ do
 done
 shift $((OPTIND-1))
 
+if [ $# -eq 0 ]; then
+  echo "Please enter a valid charfile, or use charsel -h for help."
+  charsel -l
+  exit 3
+fi
 # Redefine charfile and check file validity
 CHARFILE="$CHARDIR/charfiles/$1"
 existence