From 4763801cb221386e0adff0a0b0945861dba491b6 Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Mon, 11 Dec 2023 13:21:17 +0100 Subject: [PATCH] add `nothing -> table` to `format date` (#11290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ╰──── ``` --- crates/nu-command/src/strings/format/date.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/nu-command/src/strings/format/date.rs b/crates/nu-command/src/strings/format/date.rs index 0dd087699a..84b3ed5f98 100644 --- a/crates/nu-command/src/strings/format/date.rs +++ b/crates/nu-command/src/strings/format/date.rs @@ -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'))