Merge pull request #75539 from Gabriel439/gabriel/renderOptions

Add `pkgs.lib.encodeGNUCommandLine`
This commit is contained in:
Robert Hensing
2020-01-14 12:04:05 +01:00
committed by GitHub
3 changed files with 79 additions and 0 deletions

View File

@@ -441,4 +441,25 @@ runTests {
expected = "«foo»";
};
testRenderOptions = {
expr =
encodeGNUCommandLine
{ }
{ data = builtins.toJSON { id = 0; };
X = "PUT";
retry = 3;
retry-delay = null;
url = [ "https://example.com/foo" "https://example.com/bar" ];
silent = false;
verbose = true;
};
expected = "'-X' 'PUT' '--data' '{\"id\":0}' '--retry' '3' '--url' 'https://example.com/foo' '--url' 'https://example.com/bar' '--verbose'";
};
}