mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 01:09:37 +01:00
nix list-options: Ignore eval errors for now
This commit is contained in:
parent
db204f40d2
commit
afebbb876f
1 changed files with 11 additions and 5 deletions
|
|
@ -55,11 +55,17 @@ struct CmdListOptions : InstallableCommand
|
||||||
auto aValue = aFinal->value->attrs->get(option->name);
|
auto aValue = aFinal->value->attrs->get(option->name);
|
||||||
assert(aValue);
|
assert(aValue);
|
||||||
|
|
||||||
std::ostringstream str;
|
try {
|
||||||
JSONPlaceholder jsonOut(str);
|
std::ostringstream str;
|
||||||
PathSet context;
|
JSONPlaceholder jsonOut(str);
|
||||||
printValueAsJSON(*state, true, *aValue->value, jsonOut, context);
|
PathSet context;
|
||||||
logger->stdout(" " ANSI_BOLD "Value:" ANSI_NORMAL " %s", str.str());
|
printValueAsJSON(*state, true, *aValue->value, jsonOut, context);
|
||||||
|
logger->stdout(" " ANSI_BOLD "Value:" ANSI_NORMAL " %s", str.str());
|
||||||
|
} catch (EvalError &) {
|
||||||
|
// FIXME: should ignore "no default" errors, print
|
||||||
|
// other errors.
|
||||||
|
logger->stdout(" " ANSI_BOLD "Value:" ANSI_NORMAL " " ANSI_ITALIC "none" ANSI_NORMAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue