nushell/tests
Eric Hodel 81d00f71a9
Show plugin extra usage and search terms (#10952)
# Description

The `PluginSignature` type supports extra usage but this was not
available in `plugin_name --help`. It also supports search terms but
these did not appear in `help commands`

New behavior show below is the "Extra usage for nu-example-1" line and
the "Search terms:" line

```
❯ nu-example-1 --help
PluginSignature test 1 for plugin. Returns Value::Nothing

Extra usage for nu-example-1

Search terms: example

Usage:
  > nu-example-1 {flags} <a> <b> (opt) ...(rest)

Flags:
  -h, --help - Display the help message for this command
  -f, --flag - a flag for the signature
  -n, --named <String> - named string

Parameters:
  a <int>: required integer value
  b <string>: required string value
  opt <int>: Optional number (optional)
  ...rest <string>: rest value string

Examples:
  running example with an int value and string value
  > nu-example-1 3 bb
```

Search terms are also available in `help commands`:

```
❯ help commands | where name == "nu-example-1" | select name search_terms
╭──────────────┬──────────────╮
│     name     │ search_terms │
├──────────────┼──────────────┤
│ nu-example-1 │ example      │
╰──────────────┴──────────────╯
```

# User-Facing Changes

Users can now see plugin extra usage and search terms 

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

N/A
2023-11-04 15:12:58 -05:00
..
assets/nu_json Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
const_ Disallow duplicated columns in table literals (#10875) 2023-11-01 21:25:35 +01:00
eval Exit early when encountering parsing errors (#10213) 2023-09-05 14:36:37 +02:00
fixtures Integrated Language Server (#10723) 2023-11-02 10:18:57 -05:00
hooks Auto-expand table based on terminal width (#9934) 2023-08-08 05:47:23 -05:00
modules Recursively export constants from modules (#10049) 2023-08-20 14:51:35 +02:00
overlays Add --env and --wrapped flags to def (#10566) 2023-10-02 21:13:31 +03:00
parsing Fix parsing of signature inp/out types in predecls (#10642) 2023-10-08 12:58:26 +02:00
path change canonicalize test use a more deeply rooted folder (#10685) 2023-10-11 11:27:25 -05:00
plugins Show plugin extra usage and search terms (#10952) 2023-11-04 15:12:58 -05:00
scope Add a few more fields to scope commands (#10045) 2023-08-18 20:47:38 +03:00
shell Let run_in_login_mode succeed even with broken local config (#10622) 2023-10-10 14:12:19 +02:00
main.rs prevent redefining fields in a record (#8705) 2023-04-02 06:09:33 +12:00