From 875f57857e1d34c72b9113294bddc80dcdd539b2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 9 Mar 2009 10:13:45 +0000 Subject: [PATCH] * Require every argument to be specified. --- src/c/eval-jobs.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/c/eval-jobs.cc b/src/c/eval-jobs.cc index ebd1173f..c148210f 100644 --- a/src/c/eval-jobs.cc +++ b/src/c/eval-jobs.cc @@ -58,11 +58,9 @@ static void tryJobAlts(EvalState & state, XMLWriter & doc, } } - else if (!matchDefaultValue(def2, def)) - throw TypeError(format("cannot auto-call a function that has an argument without a default value (`%1%')") - % aterm2String(name)); else - tryJobAlts(state, doc, argsUsed, argsLeft, attrPath, fun, ATgetNext(formals), actualArgs); + throw TypeError(format("job `%1%' requires an argument named `%2%'") + % attrPath % aterm2String(name)); } @@ -165,7 +163,7 @@ void run(Strings args) if (i == args.end()) throw UsageError("missing argument"); string value = *i++; Expr e = arg == "--arg" - ? parseExprFromString(state, value, absPath(".")) + ? evalExpr(state, parseExprFromString(state, value, absPath("."))) : makeStr(value); autoArgs.set(toATerm(name), (ATerm) ATinsert(autoArgs.get(toATerm(name)) ? (ATermList) autoArgs.get(toATerm(name))