forked from extern/nushell
add nothing -> table
to format date
(#11290)
this will allow to run ```nushell format date --list | get 0 ``` and get ``` ─────────────┬─────────────────────────────────────────────────────────── Specification│%Y Example │2023 Description │The full proleptic Gregorian year, zero-padded to 4 digits. ─────────────┴─────────────────────────────────────────────────────────── ``` instead of currently ``` Error: nu::parser::input_type_mismatch × Command does not support string input. ╭─[entry #2:1:1] 1 │ format date --list | get 0 · ─┬─ · ╰── command doesn't support string input ╰──── ```
This commit is contained in:
parent
ecb3b3a364
commit
4763801cb2
@ -25,6 +25,7 @@ impl Command for FormatDate {
|
||||
.input_output_types(vec![
|
||||
(Type::Date, Type::String),
|
||||
(Type::String, Type::String),
|
||||
(Type::Nothing, Type::Table(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
|
||||
.switch("list", "lists strftime cheatsheet", Some('l'))
|
||||
|
Loading…
Reference in New Issue
Block a user