From 52696451c5ca1bf365b396f8190f3a680751c0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?On=C3=A8?= <43485962+c-git@users.noreply.github.com> Date: Wed, 25 Feb 2026 03:01:01 -0500 Subject: [PATCH 1/3] Update piping alias section for clarity Clarify that aliases do not support multiple commands and provide examples for defining commands without parameters. --- book/aliases.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/book/aliases.md b/book/aliases.md index 03f534399ad..fb52d7750eb 100644 --- a/book/aliases.md +++ b/book/aliases.md @@ -41,9 +41,9 @@ alias ll = ls -l # some other config and script loading ``` -## Piping in Aliases +## Piping / Multiple commands in Aliases -Note that `alias uuidgen = uuidgen | tr A-F a-f` (to make uuidgen on mac behave like linux) won't work. +Note aliases currently do not support including multiple commands. So for example `alias uuidgen = uuidgen | tr A-F a-f` (to make uuidgen on mac behave like linux) won't work. The solution is to define a command without parameters that calls the system program `uuidgen` via `^`. ```nu @@ -60,6 +60,30 @@ def lsg [] { ls | sort-by type name -i | grid -c | str trim } displaying all listed files and folders in a grid. +Similarly trying to chain multiple commands will not work as expected. + +```nu +alias make_calls = print call1; print call2 + +#output: +#call2 +``` + +If we try testing the alias we get: + +```nu +make_calls + +#output: +#call1 +``` + +To implement this a custom command would again be needed. + +```nu +def make_calls [] { print call1; print call2 } +``` + ## Replacing Existing Commands Using Aliases ::: warning Caution! From 2056e207d12a1b358f81ace81eaf19f9effaa823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?On=C3=A8?= <43485962+c-git@users.noreply.github.com> Date: Wed, 25 Feb 2026 09:45:05 -0500 Subject: [PATCH 2/3] Explain intention of example Add the intention that is we are attempting to achieve in the example. --- book/aliases.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/aliases.md b/book/aliases.md index fb52d7750eb..c8fc34ff74c 100644 --- a/book/aliases.md +++ b/book/aliases.md @@ -60,7 +60,7 @@ def lsg [] { ls | sort-by type name -i | grid -c | str trim } displaying all listed files and folders in a grid. -Similarly trying to chain multiple commands will not work as expected. +Similarly trying to chain multiple commands will not work as expected. In this example the aim is have `make_calls` print both call1 and call2. ```nu alias make_calls = print call1; print call2 @@ -78,7 +78,7 @@ make_calls #call1 ``` -To implement this a custom command would again be needed. +To implement the desired functionality a custom command would again be needed. ```nu def make_calls [] { print call1; print call2 } From 961f5f7caf833a8fc40a548ae0287c7400f459d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?On=C3=A8?= <43485962+c-git@users.noreply.github.com> Date: Wed, 25 Feb 2026 17:18:09 -0500 Subject: [PATCH 3/3] Update aliases.md for clarity on command chaining Clarified explanation of alias command behavior and output. --- book/aliases.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/aliases.md b/book/aliases.md index c8fc34ff74c..ac442b3100e 100644 --- a/book/aliases.md +++ b/book/aliases.md @@ -60,7 +60,7 @@ def lsg [] { ls | sort-by type name -i | grid -c | str trim } displaying all listed files and folders in a grid. -Similarly trying to chain multiple commands will not work as expected. In this example the aim is have `make_calls` print both call1 and call2. +Similarly trying to chain multiple commands also will not work. In this example the aim is have `make_calls` print both "call1" and "call2". ```nu alias make_calls = print call1; print call2 @@ -69,7 +69,7 @@ alias make_calls = print call1; print call2 #call2 ``` -If we try testing the alias we get: +It output "call2" right away because the ";" ended the alias command instead of being included in it. If we try testing the alias we only get "call1" output as seen below: ```nu make_calls