nushell/crates/nu-command
Antoine Stevan f33b60c001
deprecate --format and --list in into datetime (#10017)
related to
-
https://discord.com/channels/601130461678272522/614593951969574961/1141009665266831470

# Description
this PR
- prints a colorful warning when a user uses either `--format` or
`--list` on `into datetime`
- does NOT remove the features for now, i.e. the two options still work
- redirect to the `format date` command instead

i propose to
- land this now
- prepare a removal PR right after this
- land the removal PR in between 0.84 and 0.85

# User-Facing Changes
`into datetime --format` and `into datetime --list` will be deprecated
in 0.85.

## how it looks
- `into datetime --list` in the REPL
```nushell
> into datetime --list | first
Error:   × Deprecated option
   ╭─[entry #1:1:1]
 1 │ into datetime --list | first
   · ──────┬──────
   ·       ╰── `into datetime --list` is deprecated and will be removed in 0.85
   ╰────
  help: see `format datetime --list` instead


╭───────────────┬────────────────────────────────────────────╮
│ Specification │ %Y                                         │
│ Example       │ 2023                                       │
│ Description   │ The full proleptic Gregorian year,         │
│               │ zero-padded to 4 digits.                   │
╰───────────────┴────────────────────────────────────────────╯
```

- `into datetime --list` in a script
```nushell
> nu /tmp/foo.nu
Error:   × Deprecated option
   ╭─[/tmp/foo.nu:4:1]
 4 │ #
 5 │ into datetime --list | first
   · ──────┬──────
   ·       ╰── `into datetime --list` is deprecated and will be removed in 0.85
   ╰────
  help: see `format datetime --list` instead


╭───────────────┬────────────────────────────────────────────╮
│ Specification │ %Y                                         │
│ Example       │ 2023                                       │
│ Description   │ The full proleptic Gregorian year,         │
│               │ zero-padded to 4 digits.                   │
╰───────────────┴────────────────────────────────────────────╯
```

- `help into datetime`


![baz](https://github.com/nushell/nushell/assets/44101798/08beece0-9c89-4665-bfe4-76a32207470f)

# Tests + Formatting

# After Submitting
2023-08-17 15:20:22 -05:00
..
src deprecate --format and --list in into datetime (#10017) 2023-08-17 15:20:22 -05:00
tests Make http -f display the request headers. Closes #9912 (#10022) 2023-08-17 09:19:10 -05:00
Cargo.toml Bump quick-xml from 0.29.0 to 0.30.0 (#9870) 2023-08-14 13:58:15 +00:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00