From 04f5c3da6714487b888f2856f5406d47f0875ce4 Mon Sep 17 00:00:00 2001 From: Tuomas Hietanen Date: Mon, 7 Oct 2024 13:29:57 +0100 Subject: [PATCH 1/2] documentation update --- docs/guide/core-commandlineparsing.md | 2 ++ docs/guide/core-targets.md | 5 +++++ 2 files changed, 7 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..9a54f622bfd 100644 --- a/docs/guide/core-targets.md +++ b/docs/guide/core-targets.md @@ -89,6 +89,11 @@ Now we have the following options: ## Script with arguments +If you don't do `Target.initEnvironment()` at all, then FAKE will only use environment variables already set +(e.g. Windows: `set mything=123`) instead of parsing the command-line `-e`. + +If you want multiple environment arguments, you can do `-e a=1 -e b=2`. + Example: ```fsharp From 5fd33188047c475c8ef0cc0c36c211dcd771f114 Mon Sep 17 00:00:00 2001 From: Tuomas Hietanen Date: Wed, 9 Oct 2024 22:10:25 +0100 Subject: [PATCH 2/2] Update core-targets.md Co-authored-by: Andrii Chebukin --- docs/guide/core-targets.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/guide/core-targets.md b/docs/guide/core-targets.md index 9a54f622bfd..5af859263ed 100644 --- a/docs/guide/core-targets.md +++ b/docs/guide/core-targets.md @@ -89,8 +89,9 @@ Now we have the following options: ## Script with arguments -If you don't do `Target.initEnvironment()` at all, then FAKE will only use environment variables already set -(e.g. Windows: `set mything=123`) instead of parsing the command-line `-e`. +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`.