Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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.2 · 3.1 · 3.0