Skip to content

Commit 65341c1

Browse files
committed
feat: add documentation with example to GetAllCmdArgs
1 parent aba047a commit 65341c1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Fun.Build/StageContextExtensions.fs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace rec Fun.Build
1+
namespace rec Fun.Build
22

33
open System
44
open System.Threading
@@ -493,6 +493,17 @@ module StageContextExtensions =
493493
// If not find then return ""
494494
member inline ctx.GetEnvVar(key: string) = ctx.TryGetEnvVar key |> ValueOption.defaultValue ""
495495

496+
/// <summary>
497+
/// Get the command arguments from the command line without the remaining arguments that are placed after <c>--</c>.
498+
///
499+
/// For example, if you run the following arguments:
500+
///
501+
/// <c> -p demo test1 v1 -- test2 v2</c>
502+
///
503+
/// will return
504+
///
505+
/// <c>[ "-p"; "demo"; "test1"; "v1" ]</c>
506+
/// </summary>
496507
member ctx.GetAllCmdArgs() =
497508
match ctx.ParentContext with
498509
| ValueSome(StageParent.Pipeline p) -> p.CmdArgs

0 commit comments

Comments
 (0)