Execline: Difference between revisions
blocks section |
blocks: add an argument to cowsay |
||
| Line 52: | Line 52: | ||
pkgs.execline.passthru.writeScript "wrap-cowsay" "-s0" '' | pkgs.execline.passthru.writeScript "wrap-cowsay" "-s0" '' | ||
pipeline -w { ${pkgs.lib.getExe pkgs.cowsay} } | pipeline -w { ${pkgs.lib.getExe pkgs.cowsay} "-r" } | ||
$@ | $@ | ||
'' | '' | ||
| Line 71: | Line 71: | ||
then the expression | then the expression | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
args: lib.escapeShellArgs (quoteExecline [ "pipeline" "-w" [ (lib.getExe pkgs.cowsay) ] ] ++ args) | args: lib.escapeShellArgs (quoteExecline [ "pipeline" "-w" [ (lib.getExe pkgs.cowsay) "-r" ] ] ++ args) | ||
</syntaxHighlight> | </syntaxHighlight> | ||
would produce the command-line executed by <code>execlineb</code> in the previous "wrap-cowsay" example when given the same arguments. | would produce the command-line executed by <code>execlineb</code> in the previous "wrap-cowsay" example when given the same arguments. | ||
[[Category:Cookbook]] | [[Category:Cookbook]] | ||