nushell/crates/nu-command/src
Bahex f63cecc316
add metadata access command (#13785)
# Description
Add `metadata access`, which allows accessing/inspecting the metadata of
a stream in a closure.
```nu
ls | metadata access {|meta|
    ...
}
```

- The metadata is provided as an argument to the closure, identical to
the record obtained with `metadata` command.

- `metadata access` passes its input stream into the closure as it is.

- Within the closure, both the metadata and the stream are available.
The closure may modify, collect or pass the stream as it is.

# Motivation
- Without this command, nu code can't act on metadata without losing the
stream, use cases requiring both the stream and metadata must be
implemented either as a built-in or a plugin.

- This command allows users to enhance presentation of data, similar to
`table` coloring the output of `ls`.
2024-09-11 12:44:06 -05:00
..
bytes Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
charting doc: fix broken doc links (#13644) 2024-08-23 21:17:44 +02:00
conversions Add split cell-path (#13705) 2024-08-28 23:01:26 +02:00
database Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
date Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
debug add metadata access command (#13785) 2024-09-11 12:44:06 -05:00
env Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
experimental Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
filesystem Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
filters Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
formats Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
generators Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
hash Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
help fixed issue with find not working with symbols that should be escaped (#13792) 2024-09-06 07:22:03 +08:00
math Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
misc Changed category for panic and added search terms and examples (#13707) 2024-08-27 16:58:05 -07:00
network Refining error handling in http post (#13805) 2024-09-07 23:57:34 +02:00
path Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
platform Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
random Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
removed Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
shells Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
stor Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
strings Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
system doc: fix broken doc links (#13644) 2024-08-23 21:17:44 +02:00
viewers remove config use_grid_icons, move to parameter of grid command (#13788) 2024-09-06 07:25:43 +08:00
default_context.rs add metadata access command (#13785) 2024-09-11 12:44:06 -05:00
example_test.rs Overhaul $in expressions (#13357) 2024-07-17 16:02:42 -05:00
lib.rs Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
progress_bar.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
sort_utils.rs Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00