diff --git a/bin/git-fame b/bin/git-fame index 83525e7..0453659 100755 --- a/bin/git-fame +++ b/bin/git-fame @@ -28,7 +28,7 @@ unless GitFame::SORT.include?(opts[:sort]) Trollop::die :sort, "must be one of the following; #{GitFame::SORT.join(", ")}" end -if opts[:timeout] <= 0 +if opts[:timeout] != -1 and opts[:timeout] <= 0 Trollop::die :timeout, "must be positive" end diff --git a/spec/bin_spec.rb b/spec/bin_spec.rb index f897caa..06a7ae2 100644 --- a/spec/bin_spec.rb +++ b/spec/bin_spec.rb @@ -34,7 +34,8 @@ "--help", "--verbose", "--everything", - "--timeout=10" + "--timeout=10", + "--timeout=-1" ].each do |option| it "should support #{option}" do run(option).should be_a_succees @@ -67,8 +68,8 @@ it "should fail on invalid timeout" do run("--timeout=hello").should_not be_a_succees run("--timeout=").should_not be_a_succees - run("--timeout=-1").should_not be_a_succees run("--timeout=0").should_not be_a_succees + run("--timeout=-2").should_not be_a_succees end it "should not print stack trace on invalid dates (--before)" do