summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormokha <mokha@cisco.com>2018-03-20 18:55:18 -0600
committermokha <mokha@cisco.com>2018-03-20 18:55:18 -0600
commitac3fe9af3d102b8d2b24b71a0d1cedeab9f806c4 (patch)
treecfcbc3f05334f6de49847107be6fa62131380899 /lib
parent4d23a77e4d9333a0649ae645f2d1e511b63ec4fa (diff)
fix bug in distance.
Diffstat (limited to 'lib')
-rw-r--r--lib/xsay.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/xsay.rb b/lib/xsay.rb
index c0a4793..07935aa 100644
--- a/lib/xsay.rb
+++ b/lib/xsay.rb
@@ -6,7 +6,7 @@ module Xsay
class CLI < Thor
ANIMALS=Dir[File.expand_path("xsay/templates/*.template", File.dirname(__FILE__))]
class_option :colour, default: :default, required: false
- class_option :distance, default: 1, required: false, type: :numeric
+ class_option :distance, default: 0, required: false, type: :numeric
class_option :speed, default: 1, required: false, type: :numeric
ANIMALS.each do |filename|
@@ -42,7 +42,7 @@ module Xsay
)
message = message.join(' ') if message.respond_to?(:join)
line_break = "-" * message.length
- move = distance > 1
+ move = distance > 0
distance.downto(0) do |n|
system 'clear' if move
spaces = " " * n