lib/cli.rb in exercism-0.0.22 vs lib/cli.rb in exercism-0.0.23
- old
+ new
@@ -46,17 +46,24 @@
report(assignments)
end
desc "submit FILE", "Submit code to exercism.io on your current assignment"
method_option :host, :aliases => '-h', :default => 'http://exercism.io', :desc => 'the url of the exercism application'
+ method_option :ask, :aliases => '-a', :default => false, :type => :boolean, :desc => 'ask before submitting assignment'
def submit(file)
require 'exercism'
submission = Submission.new(file)
if submission.test?
say "It looks like this is a test, you probably don't want to do that."
if no?("Do you want to submit it anyway? [y/n]")
+ return
+ end
+ end
+
+ if options[:ask]
+ if no?("Are you sure you want to submit this assignment? [y/n]")
return
end
end
begin