Permalink
Browse files

Allow spaced input

This allows input like "1, 2, 4, 7, 9" which is sometimes useful
with longer lists.
  • Loading branch information...
1 parent 7be4cf9 commit b597103356d5f5831a7e9708584f7cd9c19a3b64 @patricklucas patricklucas committed Nov 15, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 spark
View
@@ -133,9 +133,9 @@ while getopts ":h" option; do
done
# Accept input from $1 or from the pipeline.
-if test "$1" != ""
+if [ -n "$*" ]
then
- data="$1"
+ data="$*"
else
# check to see if stdin's a tty
if [ -t 0 ]; then
@@ -146,5 +146,8 @@ else
read data
fi
+# Trim spaces to allow input like '1, 2, 3'
+data=$(echo $data | tr -d ' ')
+
setup_array $data
print_ticks $data

0 comments on commit b597103

Please sign in to comment.