Commit 0c9ea1ed authored by Daniel Paul Searles's avatar Daniel Paul Searles Committed by Jan Provaznik

Update secpick to be more specific with errors

Why:

* When using secpick and missing an option it's hard to know which error
  is missing.

This change addresses the need by:

* Update secpick to output which options are missing.
parent 6327fdde
...@@ -159,7 +159,11 @@ module Secpick ...@@ -159,7 +159,11 @@ module Secpick
options[:branch] ||= `git rev-parse --abbrev-ref HEAD` options[:branch] ||= `git rev-parse --abbrev-ref HEAD`
options[:remote] ||= DEFAULT_REMOTE options[:remote] ||= DEFAULT_REMOTE
abort("Missing options. Use #{$0} --help to see the list of options available".red) if options.value?(nil) nil_options = options.select {|_, v| v.nil? }
unless nil_options.empty?
abort("Missing: #{nil_options.keys.join(', ')}. Use #{$0} --help to see the list of options available".red)
end
abort("Wrong version format #{options[:version].bold}".red) unless options[:version] =~ /\A\d*\-\d*\Z/ abort("Wrong version format #{options[:version].bold}".red) unless options[:version] =~ /\A\d*\-\d*\Z/
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment