From 6ac2db86449ee6fe1befc5b7251f283cfb28a510 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 31 Aug 2023 09:18:29 -0400 Subject: [PATCH] Use parse! for OptionParser --- exe/ruby-lsp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exe/ruby-lsp b/exe/ruby-lsp index 5fbc38539..f949c853c 100755 --- a/exe/ruby-lsp +++ b/exe/ruby-lsp @@ -3,6 +3,7 @@ require "optparse" +original_args = ARGV.dup options = {} parser = OptionParser.new do |opts| opts.banner = "Usage: ruby-lsp [options]" @@ -33,7 +34,7 @@ parser = OptionParser.new do |opts| end begin - parser.parse + parser.parse! rescue OptionParser::InvalidOption => e warn(e) warn("") @@ -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"