Skip to content

aliases should be listed in help alias or $nu.scope.aliases and externals in help externals #8301

@amtoine

Description

@amtoine

EDIT / TL;DR: we've identified two points here

Describe the bug

i have a bunch of aliases in my nushell config, but none of them appear in help aliases

Note
in all that follows, help aliases can be replaced by $nu.scope.aliases and the same behaviour occurs

to be more precise, only the ones defined with old-alias appear

>_ help aliases
╭───┬──────┬──────────────┬─────────────────╮
│ # │ name │  expansion   │      usage      │
├───┼──────┼──────────────┼─────────────────┤
│ 0 │ cp   │ cp --verbose │ be more verbose │
│ 1 │ mv   │ mv --verbose │                 │
│ 2 │ rm   │ rm --verbose │                 │
│ 3 │ sl   │ sl -aw -20   │                 │
╰───┴──────┴──────────────┴─────────────────╯

Note
the aliases: https://github.com/amtoine/goatfiles-dotfiles/blob/bleeding/.config/nushell/lib/personal/aliases.nu

How to reproduce

  1. help aliases | where name == bar
╭────────────╮
│ empty list │
╰────────────╯
  1. alias bar = echo "this is bar"
  2. bar
this is bar
  1. help aliases | where name == bar
╭────────────╮
│ empty list │
╰────────────╯

and with the old-alias
5. old-alias bar = echo "this is bar"
6. bar

this is bar
  1. help aliases | where name =~ bar
╭───┬──────┬────────────────────┬───────╮
│ # │ name │     expansion      │ usage │
├───┼──────┼────────────────────┼───────┤
│ 0 │ bar  │ echo "this is bar" │       │
╰───┴──────┴────────────────────┴───────╯

Expected behavior

i expected to see

>_ help aliases | where name == bar
╭───┬──────┬────────────────────┬───────╮
│ # │ name │     expansion      │ usage │
├───┼──────┼────────────────────┼───────┤
│ 0 │ bar  │ echo "this is bar" │       │
╰───┴──────┴────────────────────┴───────╯

after a single

alias bar = echo "this is bar"

Screenshots

No response

Configuration

key value
version 0.76.1
branch main
commit_hash a7b5bd1
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.66.1 (90743e729 2023-01-10)
rust_channel 1.66.1-x86_64-unknown-linux-gnu
cargo_version cargo 1.66.1 (ad779e08b 2023-01-10)
pkg_version 0.76.1
build_time 2023-03-03 19:26:08 +01:00
build_rust_channel release
features default, zip
installed_plugins gstat

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:aliasIssues around support for command aliases, touches parser and name resolutiongood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions