nushell/crates/nu-cmd-lang/src/core_commands
Devyn Cairns 6795ad7e33
Make custom value type handling more consistent (#12230)
[Context on
Discord](https://discord.com/channels/601130461678272522/855947301380947968/1219425984990806207)

# Description

- Rename `CustomValue::value_string()` to `type_name()` to reflect its
usage better.
- Change print behavior to always call `to_base_value()` first, to give
the custom value better control over the output.
- Change `describe --detailed` to show the type name as the subtype,
rather than trying to describe the base value.
- Change custom `Type` to use `type_name()` rather than `typetag_name()`
to make things like `PluginCustomValue` more transparent

One question: should `describe --detailed` still include a description
of the base value somewhere? I'm torn on it, it seems possibly useful
for some things (maybe sqlite databases?), but having `describe -d` not
include the custom type name anywhere felt weird. Another option would
be to add another method to `CustomValue` for info to be displayed in
`describe`, so that it can be more type-specific?

# User-Facing Changes
Everything above has implications for printing and `describe` on custom
values

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
2024-03-19 11:09:59 +01:00
..
overlay IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
scope Change category of scope commands to core (#10892) 2023-10-30 19:55:40 +01:00
alias.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
break_.rs Convert remainder of ShellError variants to named fields (#11276) 2023-12-09 18:46:21 -06:00
collect.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
const_.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
continue_.rs Convert remainder of ShellError variants to named fields (#11276) 2023-12-09 18:46:21 -06:00
def.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
describe.rs Make custom value type handling more consistent (#12230) 2024-03-19 11:09:59 +01:00
do_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
echo.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
error_make.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
export_alias.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
export_const.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
export_def.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
export_extern.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
export_module.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
export_use.rs Use rest argument in export use to match use (#12228) 2024-03-18 20:37:53 +01:00
export.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
extern_.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
for_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
hide_env.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
hide.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
if_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
ignore.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
lazy_make.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
let_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
loop_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
match_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
mod.rs Keep plugins persistently running in the background (#12064) 2024-03-09 17:10:22 -06:00
module.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
mut_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
plugin_list.rs Keep plugins persistently running in the background (#12064) 2024-03-09 17:10:22 -06:00
plugin_stop.rs Keep plugins persistently running in the background (#12064) 2024-03-09 17:10:22 -06:00
plugin.rs Keep plugins persistently running in the background (#12064) 2024-03-09 17:10:22 -06:00
register.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
return_.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
try_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
use_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
version.rs Remove feat extra and include in default (#12140) 2024-03-10 17:29:02 +01:00
while_.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00