Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OptionParser#environment

environment(env = File.basename($0, '.*'))

Parses environment variable env or its uppercase with splitting like a shell.

env defaults to the basename of the program.

See also #def_tail_option #getopts #def_option #help also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0