Skip to content

Instantly share code, notes, and snippets.

@grishace
Created March 24, 2019 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grishace/355c429bcae2a20d88341d889e17c956 to your computer and use it in GitHub Desktop.
Save grishace/355c429bcae2a20d88341d889e17c956 to your computer and use it in GitHub Desktop.
Adding arbitrary key=value pairs to the FAKE script
fake build -t all --env a=b --env c=d --env e=f
*** [Env ("a","b"); Env ("c","d"); Env ("e","f")]
open Argu
type EnvVars = | [<EqualsAssignment>] Env of key:string * value:string
with
interface IArgParserTemplate with
member __.Usage = ""
let parser = ArgumentParser.Create<EnvVars>()
let results = parser.ParseCommandLine(System.Environment.GetCommandLineArgs(), true, true, false)
printfn "*** %A" (results.GetAllResults())
// ...
Target.runOrDefaultWithArguments "All"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment