mirror of
https://github.com/NixOS/nix
synced 2025-07-12 23:15:08 +02:00
* Option --argstr for passing string arguments easily. (NIX-75)
This commit is contained in:
parent
4e329f173f
commit
e418976107
11 changed files with 88 additions and 28 deletions
1
tests/lang/eval-okay-autoargs.exp
Normal file
1
tests/lang/eval-okay-autoargs.exp
Normal file
|
@ -0,0 +1 @@
|
|||
Str("xyzzy!xyzzy!foobar",[])
|
1
tests/lang/eval-okay-autoargs.flags
Normal file
1
tests/lang/eval-okay-autoargs.flags
Normal file
|
@ -0,0 +1 @@
|
|||
--arg lib import(lang/lib.nix) --argstr xyzzy xyzzy! -A result
|
15
tests/lang/eval-okay-autoargs.nix
Normal file
15
tests/lang/eval-okay-autoargs.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
let
|
||||
|
||||
foobar = "foobar";
|
||||
|
||||
in
|
||||
|
||||
{ xyzzy2 ? xyzzy # mutually recursive args
|
||||
, xyzzy ? "blaat" # will be overriden by --argstr
|
||||
, fb ? foobar
|
||||
, lib # will be set by --arg
|
||||
}:
|
||||
|
||||
{
|
||||
result = lib.concat [xyzzy xyzzy2 fb];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue