Skip to content

Commit

Permalink
Merge 0c4711a into 7eb9a13
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviomartins committed Mar 12, 2019
2 parents 7eb9a13 + 0c4711a commit b0e54ab
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/twurl/cli.rb
Expand Up @@ -41,8 +41,6 @@ def dispatch(options)
end

def parse_options(args)
arguments = args.dup

Twurl.options = Options.new
Twurl.options.trace = false
Twurl.options.data = {}
Expand Down Expand Up @@ -91,15 +89,15 @@ def parse_options(args)
end
end

arguments = option_parser.parse!(args)
Twurl.options.command = extract_command!(arguments)
Twurl.options.path = extract_path!(arguments)

if Twurl.options.command == DEFAULT_COMMAND and Twurl.options.path.nil?
if args.first.nil?
CLI.puts option_parser
raise NoPathFound, "No path found"
end

arguments = option_parser.parse!(args)
Twurl.options.command = extract_command!(arguments)
Twurl.options.path = extract_path!(arguments)

Twurl.options.subcommands = arguments
Twurl.options
end
Expand Down

0 comments on commit b0e54ab

Please sign in to comment.