unison/unison-src/transcripts/names.md
Greg Pfeil 75c228f4e1
Use CommonMark-compatible info strings everywhere
The bulk of this updates transcripts to put spaces around the language
name in code blocks. E.g.,
```` markdown
```ucm:hide
````
becomes
```` markdown
``` ucm :hide
````

This corresponds to
https://share.unison-lang.org/@unison/website/contributions/11, which
updates the docs in the same way.

This is effectively a fix for #5214, but that issue also has good recommendations for future changes to info strings, so
I don’t know that it should be closed.
2024-10-08 14:23:34 -06:00

45 lines
1.1 KiB
Markdown

# `names` command
``` ucm
scratch/main> builtins.merge lib.builtins
```
Example uses of the `names` command and output
``` unison
-- Some names with the same value
some.place.x = 1
some.otherplace.y = 1
some.otherplace.x = 10
somewhere.z = 1
-- Some similar name with a different value
somewhere.y = 2
```
``` ucm
scratch/main> add
```
`names` searches relative to the current path.
``` ucm
-- We can search by suffix and find all definitions named 'x', and each of their aliases respectively.
scratch/main> names x
-- We can search by hash, and see all aliases of that hash
scratch/main> names #gjmq673r1v
-- Works with absolute names too
scratch/main> names .some.place.x
```
`debug.names.global` searches from the root, and absolutely qualifies results
``` ucm
-- We can search from a different branch and find all names in the codebase named 'x', and each of their aliases respectively.
scratch/other> debug.names.global x
-- We can search by hash, and see all aliases of that hash in the codebase
scratch/other> debug.names.global #gjmq673r1v
-- We can search using an absolute name
scratch/other> debug.names.global .some.place.x
```