CLI::Args: Make processed_options read-only
This commit is contained in:
parent
28e62b52d1
commit
2b95755afe
@ -5,7 +5,7 @@ require "ostruct"
|
||||
module Homebrew
|
||||
module CLI
|
||||
class Args < OpenStruct
|
||||
attr_accessor :processed_options, :args_parsed
|
||||
attr_reader :processed_options, :args_parsed
|
||||
# undefine tap to allow --tap argument
|
||||
undef tap
|
||||
|
||||
@ -16,6 +16,12 @@ module Homebrew
|
||||
@processed_options = []
|
||||
end
|
||||
|
||||
def freeze_processed_options!(processed_options)
|
||||
@processed_options += processed_options
|
||||
@processed_options.freeze
|
||||
@args_parsed = true
|
||||
end
|
||||
|
||||
def option_to_name(option)
|
||||
option.sub(/\A--?/, "")
|
||||
.tr("-", "_")
|
||||
|
||||
@ -140,10 +140,10 @@ module Homebrew
|
||||
end
|
||||
check_constraint_violations
|
||||
@args[:remaining] = remaining_args
|
||||
@args.args_parsed = @args_parsed = true
|
||||
@args.processed_options = @processed_options
|
||||
@args.freeze_processed_options!(@processed_options)
|
||||
Homebrew.args = @args
|
||||
cmdline_args.freeze
|
||||
@args_parsed = true
|
||||
@parser
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user