lib/grepg/parser.rb in grepg-0.0.4 vs lib/grepg/parser.rb in grepg-0.0.5

- old
+ new

@@ -45,10 +45,15 @@ colorize: true EOS end @opts = Trollop::with_standard_exception_handling parser do - parser.parse args + opts = parser.parse args + # User is a required field, manually handling validation because + # we fallback on defaults from the file + raise Trollop::CommandlineError, + "Missing --user parameter. e.g. --user evidanary" unless opts[:user] + opts end @user = @opts[:user] @topic = @opts[:topic] @search_term = @opts[:search]