Skip to content

Identical command names across different modules will cause --help flag to conflate subcommands #11447

@crabdancing

Description

@crabdancing

Describe the bug

If one module contains a def with a subcommand colliding with another module's name, the help generator gets completely confused.

How to reproduce

Setup test:

mkdir bug-demo
cd bug-demo

touch mod.nu

'export def "list" [
] {
  seq char a z
}' | save letters.nu

'export def "list some" [
] {
  seq 0 10
}

export def "list a-lot" [
] {
  seq 0 10000
}' | save numbers.nu

If you then do:

use . *
letters --help

You will see:

  > list

Subcommands:
  list a-lot -
  list some -

Flags:
  -h, --help - Display the help message for this command

Input/output types:
  ╭───┬───────┬────────╮
  │ # │ input │ output │
  ├───┼───────┼────────┤
  │ 0 │ any   │ any    │
  ╰───┴───────┴────────╯

Expected behavior

I expected the help message to show the qualified name of the command (numbers list, not just list), and to not show any subcommands it does not actually have (some, a-lot).

Screenshots

No response

Configuration

key value
version 0.88.1
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.74.0 (79e9716c9 2023-11-13) (built from a source tarball)
cargo_version cargo 1.74.0
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, extra, sqlite, trash, which, zip
installed_plugins from eml, from ics, from ini, from vcf, gstat, net, query, query json, query web, query xml, regex

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:help-systemRelated to help commands and our documentation system (not docs itself)status:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions