Giter Site home page Giter Site logo

Comments (6)

fdncred avatar fdncred commented on July 3, 2024 3

I also don't like how shells --help lists show in the usage above. If I had my way, it would look more like this.

 shells --help
Display current working directories.

Usage:
  > shells (an alias to `show`)

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

Another thing that bothers me is that help shells is different than shells --help.

 help shells
Alias for `show`

Alias: shells

Expansion:
  show
 shells --help 
Display current working directories.

Usage:
  > show

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

from nushell.

fdncred avatar fdncred commented on July 3, 2024 2

These are the commands that are available without doing a use std in the repl.

# Define the `std` module
module std
# Prelude
use std dirs [
enter
shells
g
n
p
dexit
]
use std pwd
"#;

You'll notice that show isn't in there but its alias shells is.

 shells --help
Display current working directories.

Usage:
  > show

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

However, I do agree that this stuff should work better.

from nushell.

NotTheDr01ds avatar NotTheDr01ds commented on July 3, 2024

Yes, it's confused me in the past as well, and I only now think I'm starting to grok it. Put slightly differently, those aliases are defined in std. It's possible for an alias in a module to:

  • point to a command in that module
  • still be valid even if the original command itself hasn't been imported

Those aliases are imported at startup, but the original commands they point to are not.

However, I do agree that this stuff should work better.

+1 ;-)

(Rough thinking without any validation or research) Perhaps the original commands should also be imported? Or just reverse the alias and command names?

from nushell.

backwardspy avatar backwardspy commented on July 3, 2024

interesting, thanks for the added context! that does make sense.
so this isn't a bug, just some potentially confusing help messages.

from nushell.

ErichDonGubler avatar ErichDonGubler commented on July 3, 2024

As @fdncred noted, this issue applies to all commands in the shells category. Not only are they exposed in a "prelude", these aliases are presented like other built-ins in documentation, too.

Oddly, the officials docs pages for dexit and enter on the Wayback Machine). Example screenshots showing the resolved drop and add commands in the Usage section1:

Screenshot 2024-06-30 at 7 42 16 PM Screenshot 2024-06-30 at 7 42 27 PM

Footnotes

  1. A keen observer might note that there's other incorrect help, i.e., the dexit has a Subcommands section that appears to be incorrectly re-used from the drop built-in. I've filed an issue for this at #13278.

from nushell.

fdncred avatar fdncred commented on July 3, 2024

Oddly, the officials docs pages for dexit and enter on the Wayback Machine). Example screenshots showing the resolved drop and add commands in the Usage section1:

I'm guessing that this is because exit and enter used to be normal nushell Rust commands. Changing them to the stdlib, which is all nushell scripting, was one of our first attempts at moving commands from Rust to nushell scripting. Although, it could be because the code has changed so much and there's a bug too.

from nushell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.