Skip to content

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

instance method

OptionParser#load

load(filename = nil)

Loads options from file names as filename. Does nothing when the file is not present. Returns whether successfully loaded.

filename defaults to basename of the program without suffix in a directory ~/.options, then the basename with ‘.options’ suffix under XDG and Haiku standard places.

See also #inc #make_switch #help #new also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0