Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

OptionParser#load

(?::String filename) -> bool
load(filename = nil, **keywords)

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.

The optional into keyword argument works exactly like that accepted in method parse.

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