withFeatureAs
lib.withFeatureAs
Docs pulled from | This Revision | about 1 hour ago
Create an --{with-=,without-} string that can be passed to standard GNU Autoconf scripts.
Inputs
flag
- 1. Function argument
feature
- 2. Function argument
value
- 3. Function argument
Type
withFeatureAs :: bool -> string -> string -> string
Examples
lib.strings.withFeatureAs
usage example
withFeatureAs true "shared" "foo"
=> "--with-shared=foo"
withFeatureAs false "shared" (throw "ignored")
=> "--without-shared"
Noogle detected
Implementation
The following is the current implementation of this function.
withFeatureAs = flag: feature: value:
withFeature flag feature + optionalString flag "=${value}";