Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Setting a = Setting {
- settingDasheds :: ![Dashed]
- settingReaders :: ![Reader a]
- settingTryArgument :: !Bool
- settingSwitchValue :: !(Maybe a)
- settingTryOption :: !Bool
- settingEnvVars :: !(Maybe (NonEmpty String))
- settingConfigVals :: !(Maybe (NonEmpty (NonEmpty String, DecodingCodec a)))
- settingDefaultValue :: !(Maybe (a, String))
- settingExamples :: ![String]
- settingHidden :: !Bool
- settingMetavar :: !(Maybe Metavar)
- settingHelp :: !(Maybe String)
- help :: String -> Builder a
- metavar :: String -> Builder a
- argument :: Builder a
- option :: Builder a
- switch :: a -> Builder a
- reader :: Reader a -> Builder a
- str :: IsString s => Reader s
- auto :: Read a => Reader a
- long :: String -> Builder a
- short :: Char -> Builder a
- env :: String -> Builder a
- conf :: HasCodec a => String -> Builder a
- confWith :: String -> ValueCodec void a -> Builder a
- confWith' :: String -> ValueCodec void (Maybe a) -> Builder a
- name :: HasCodec a => String -> Builder a
- value :: Show a => a -> Builder a
- valueWithShown :: a -> String -> Builder a
- example :: String -> Builder a
- shownExample :: Show a => a -> Builder a
- hidden :: Builder a
- newtype Builder a = Builder {}
- showSettingABit :: Setting a -> ShowS
- completeBuilder :: Builder a -> Setting a
- emptySetting :: Setting a
- data DecodingCodec a = forall void. DecodingCodec (ValueCodec void (Maybe a))
- type Metavar = String
- type Help = String
Documentation
A setting for parsing and documenting a single value.
Setting | |
|
Builders
reader :: Reader a -> Builder a Source #
Declare how to parse an argument, option, or environment variable.
conf :: HasCodec a => String -> Builder a Source #
Try to parse a configuration value at the given key.
Multiple conf
s will be tried in order.
confWith' :: String -> ValueCodec void (Maybe a) -> Builder a Source #
Like confWith
but allows interpreting Null
as a value other than "Not found".
value :: Show a => a -> Builder a Source #
Set the default value
Multiple value
s override eachother.
API Note: default
is not a valid identifier in Haskell.
I'd also have preferred default
instead.
valueWithShown :: a -> String -> Builder a Source #
Set the default value, along with a shown version of it.
example :: String -> Builder a Source #
Provide an example value for documentation.
The example is provided as a literal string.
If you use reader
auto
, you'll want to use shownExample
instead.
shownExample :: Show a => a -> Builder a Source #
Internal
data DecodingCodec a Source #
forall void. DecodingCodec (ValueCodec void (Maybe a)) |