LTP GCOV extension - code coverage report
Current view: directory - src/libexpr - common-opts.cc
Test: app.info
Date: 2008-11-20 Instrumented lines: 11
Code covered: 90.9 % Executed lines: 10

       1                 : #include "common-opts.hh"
       2                 : #include "../libmain/shared.hh"
       3                 : #include "util.hh"
       4                 : #include "parser.hh"
       5                 : 
       6                 : 
       7                 : namespace nix {
       8                 : 
       9                 : 
      10                 : bool parseOptionArg(const string & arg, Strings::iterator & i,
      11                 :     const Strings::iterator & argsEnd, EvalState & state,
      12             567 :     ATermMap & autoArgs)
      13                 : {
      14             567 :     if (arg != "--arg" && arg != "--argstr") return false;
      15                 : 
      16               2 :     UsageError error(format("`%1%' requires two arguments") % arg);
      17                 :     
      18               2 :     if (i == argsEnd) throw error;
      19               2 :     string name = *i++;
      20               2 :     if (i == argsEnd) throw error;
      21               2 :     string value = *i++;
      22                 :     
      23                 :     Expr e = arg == "--arg"
      24                 :         ? parseExprFromString(state, value, absPath("."))
      25               2 :         : makeStr(value);
      26               2 :     autoArgs.set(toATerm(name), e);
      27                 :     
      28               2 :     return true;
      29                 : }
      30                 : 
      31               0 :  
      32                 : }

Generated by: LTP GCOV extension version 1.6