From 048b97be17f0e86b86273c6590d920ec779c05ca Mon Sep 17 00:00:00 2001 From: Tuomas Hietanen Date: Tue, 12 Nov 2024 12:12:52 +0000 Subject: [PATCH] Environment variable documentation update (#2840) Co-authored-by: Andrii Chebukin --- docs/guide/core-commandlineparsing.md | 2 ++ docs/guide/core-targets.md | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/docs/guide/core-commandlineparsing.md b/docs/guide/core-commandlineparsing.md index 74ec49597d7..e1795888f52 100644 --- a/docs/guide/core-commandlineparsing.md +++ b/docs/guide/core-commandlineparsing.md @@ -38,6 +38,8 @@ match DocoptResult.tryGetArgument "-m" results with *Note the following links are permalinks to old commits. They are intended only as examples. You are encouraged to look at the current version too, because it's likely to have been updated.* +See also: https://fake.build/guide/core-targets.html#Script-with-arguments + A more sophisticated example can be found in the fake runner: [src/app/Fake.netcore/Program.fs#L204-L259](https://github.com/fsharp/FAKE/blob/64d871f5065412fe7b233025e454ccf3b89e46d7/src/app/Fake.netcore/Program.fs#L204-L259) Or the target module: diff --git a/docs/guide/core-targets.md b/docs/guide/core-targets.md index 2bf5d9ec9a6..5af859263ed 100644 --- a/docs/guide/core-targets.md +++ b/docs/guide/core-targets.md @@ -89,6 +89,12 @@ Now we have the following options: ## Script with arguments +If you don't call `Target.initEnvironment()` before you use the `Environment` module, +then FAKE will only use system and inline environment variables +(e.g. Windows: `set mything=123`) instead of parsing the command line `-e` params. + +If you want multiple environment arguments, you can do `-e a=1 -e b=2`. + Example: ```fsharp