Skip to content

Commit

Permalink
Use parse! for OptionParser (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Aug 31, 2023
1 parent 3e59910 commit d361007
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exe/ruby-lsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

require "optparse"

original_args = ARGV.dup
options = {}
parser = OptionParser.new do |opts|
opts.banner = "Usage: ruby-lsp [options]"
Expand Down Expand Up @@ -33,7 +34,7 @@ parser = OptionParser.new do |opts|
end

begin
parser.parse
parser.parse!
rescue OptionParser::InvalidOption => e
warn(e)
warn("")
Expand All @@ -56,7 +57,7 @@ if ENV["BUNDLE_GEMFILE"].nil?

env = { "BUNDLE_GEMFILE" => bundle_gemfile }
env["BUNDLE_PATH"] = bundle_path if bundle_path
exit exec(env, "bundle exec ruby-lsp #{ARGV.join(" ")}")
exit exec(env, "bundle exec ruby-lsp #{original_args.join(" ")}")
end

require "sorbet-runtime"
Expand Down

0 comments on commit d361007

Please sign in to comment.