1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 19:23:54 +02:00

* Option --argstr for passing string arguments easily. (NIX-75)

This commit is contained in:
Eelco Dolstra 2007-01-14 12:32:44 +00:00
parent 4e329f173f
commit e418976107
11 changed files with 88 additions and 28 deletions

View file

@ -40,7 +40,11 @@ for i in lang/eval-okay-*.nix; do
i=$(basename $i .nix)
if test -e lang/$i.exp; then
if ! $nixinstantiate --eval-only lang/$i.nix > lang/$i.out; then
flags=
if test -e lang/$i.flags; then
flags=$(cat lang/$i.flags)
fi
if ! $nixinstantiate $flags --eval-only lang/$i.nix > lang/$i.out; then
echo "FAIL: $i should evaluate"
fail=1
elif ! $aterm_bin/atdiff lang/$i.out lang/$i.exp; then

View file

@ -0,0 +1 @@
Str("xyzzy!xyzzy!foobar",[])

View file

@ -0,0 +1 @@
--arg lib import(lang/lib.nix) --argstr xyzzy xyzzy! -A result

View 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];
}