Skip to content

help commands and $nu.scope.commands should both have name columns instead of one being called command #6922

Closed

Description

@webbedspace

Describe the bug

I was trying to do some work with $nu.scope.commands, but was repeatedly getting hurled because, even though $nu.scope.commands is supposed to be a superset of help commands's output, it uses a completely different name for one of its columns. (See title).

How to reproduce

〉$nu.scope.commands | columns
╭────┬───────────────╮
│  0 │ command       │
│  1 │ module_name   │
│  2 │ category      │
│  3 │ signature     │
│  4 │ usage         │
│  5 │ examples      │
│  6 │ is_builtin    │
│  7 │ is_sub        │
│  8 │ is_plugin     │
│  9 │ is_custom     │
│ 10 │ is_keyword    │
│ 11 │ is_extern     │
│ 12 │ creates_scope │
│ 13 │ extra_usage   │
│ 14 │ search_terms  │
╰────┴───────────────╯
〉help commands | columns
╭───┬──────────────╮
│ 0 │ name         │
│ 1 │ category     │
│ 2 │ is_plugin    │
│ 3 │ is_custom    │
│ 4 │ is_keyword   │
│ 5 │ usage        │
│ 6 │ search_terms │
╰───┴──────────────╯
〉

Expected behavior

Both columns should be called name. I understand this may be a compat break for certain tools, so the other name (command on $nu.scope.commands) can exist in a deprecated state for awhile.

Screenshots

No response

Configuration

key value
version 0.70.0
branch
commit_hash 9ef65dc
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.64.0 (a55dd71d5 2022-09-19)
rust_channel stable-x86_64-pc-windows-msvc
cargo_version cargo 1.64.0 (387270bc7 2022-09-16)
pkg_version 0.70.0
build_time 2022-10-18 18:55:02 +00:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. fdncred commented on Oct 27, 2022

    @fdncred
    Contributor

    ya, i'm always typing $nu.scope.commands | where name = blah, and then re-typing it with the right column name. so, i vote for it to be name in both places. :)

  2. added
    category:inconsistent-behavior
    good first issue
    notes:breaking-changes
    on Oct 27, 2022
  3. dmatos2012 commented on Nov 3, 2022

    @dmatos2012
    Contributor

    This looks like some easy renaming, at least from the looks of it. If so, Id like to give it a try :)

  4. fdncred commented on Nov 3, 2022

    @fdncred
    Contributor

    please go for it.

  5. added this to the v0.72 milestone on Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

category:inconsistent-behaviorgood first issuenotes:breaking-changes

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions