Skip to content

Commit

Permalink
Merge branch 'allow_spaced_input' of https://github.com/patricklucas/…
Browse files Browse the repository at this point in the history
…spark into patricklucas-allow_spaced_input
  • Loading branch information
holman committed Nov 15, 2011
2 parents a2f142b + cf1269b commit b7f3665
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spark
Expand Up @@ -133,9 +133,9 @@ while getopts ":h" option; do
done

# Accept input from $1 or from the pipeline.
if test "$1" != ""
if test "$*" != ""
then
data="$1"
data="$*"
else
# check to see if stdin's a tty
if [ -t 0 ]; then
Expand All @@ -146,5 +146,8 @@ else
read data
fi

# Trim spaces to allow input like '1, 2, 3'
data=$(echo $data | tr -s ' ' ',')

setup_array $data
print_ticks $data

0 comments on commit b7f3665

Please sign in to comment.