Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion book/custom_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ Because `def` is a parser keyword, the command name must be known at parse time.
```nu
let name = "foo"
def $name [] { foo }
:::
```

:::

### Subcommands

You can also define subcommands of commands using a space. For example, if we wanted to add a new subcommand to [`str`](/commands/docs/str.md), we can create it by naming our subcommand starting with "str ". For example:
Expand Down
4 changes: 2 additions & 2 deletions book/thinking_in_nu.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ To make sure the first line is _displayed_, use the [`print` command](/commands/

```nu
def latest-file [] {
print "Returning last file"
ls | sort-by modified | last
print "Returning last file"
ls | sort-by modified | last
}
```

Expand Down
Loading