Skip to content

Commit

Permalink
add any -> record to metadata (#9755)
Browse files Browse the repository at this point in the history
# Description
in the help page of `metadata`, there is the following example
```nushell
ls | metadata
```
which gives the following error
```
Error: nu::parser::input_type_mismatch

  × Command does not support table input.
   ╭─[entry #2:1:1]
 1 │ ls | metadata
   ·      ────┬───
   ·          ╰── command doesn't support table input
   ╰────
```

this PR adds `any -> record` to the signatures of `metadata` to allow
the use of that kind of example.

# User-Facing Changes
`ls | metadata` will work again

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- ⚫ `toolkit test`
- ⚫ `toolkit test stdlib`

# After Submitting
  • Loading branch information
amtoine committed Jul 20, 2023
1 parent d104efd commit 693cb5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/nu-command/src/debug/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Command for Metadata {

fn signature(&self) -> nu_protocol::Signature {
Signature::build("metadata")
.input_output_types(vec![(Type::Nothing, Type::Record(vec![]))])
.input_output_types(vec![(Type::Any, Type::Record(vec![]))])
.allow_variants_without_examples(true)
.optional(
"expression",
Expand Down

0 comments on commit 693cb5c

Please sign in to comment.