Add pkgs.lib.renderOptions
This adds a new utility to intelligently convert Nix records to command line options to reduce boilerplate for simple use cases and to also reduce the likelihood of malformed command lines
This commit is contained in:
@@ -441,4 +441,20 @@ runTests {
|
||||
expected = "«foo»";
|
||||
};
|
||||
|
||||
testRenderOptions = {
|
||||
expr =
|
||||
renderOptions
|
||||
{ foo = "A";
|
||||
|
||||
bar = 1;
|
||||
|
||||
baz = null;
|
||||
|
||||
qux = true;
|
||||
|
||||
v = true;
|
||||
};
|
||||
|
||||
expected = " --bar '1' --foo 'A' --qux -v";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user