settings are the building blocks of Parsers.
setting lets you put together different builders to define what to parse.
Here are some common examples:
Argument
setting [ help "Document your argument" , reader str -- The argument is a string , argument ] :: Parser StringSwitch
setting [ help "Document your switch" , switch True -- The value of the switch when activated , longfoo-- "--foo" , shortf-- "-f" , value False -- The default value of the switch ] :: Parser BoolOption
setting [ help "Document your option" , reader str -- The argument is a string , longfoo-- "--foo" , shortf-- "-f" , option ] :: Parser StringEnvironment Variable
setting [ help "Document your environment variable" , reader str -- The argument is a string , envFOO_BAR] :: Parser StringConfiguration Value
setting [ help "Document your configuration value" , conf "foo-bar" ] :: Parser StringSome combination
setting [ help "Document your configuration value" , conf "foo-bar" ] :: Parser StringNote that parsing is always tried in this order when using a combined setting:
Argument
Switch
Option
Environment variable
Configuration value
(Hence the name of the package.)