Git Product home page Git Product logo

Comments (3)

filaretov avatar filaretov commented on July 29, 2024

Hey @stegrams, I just tried adding more documentation to a custom command like this:

# Greet a person
# 
# Specifically, say "hello" to the specified person.
def greet [
        name:string  # The person to greet
    ] {
    echo $"Hello, ($name)!"
}

And it worked:

> help greet
Greet a person

Specifically, say "hello" to the specified person.

Usage:
  > greet <$name> {flags}

Parameters:
  <$name> The person to greet

Flags:
  -h, --help: Display this help message

I also put it directly in config.toml like this:

startup = [
"""
# Greet a person
# 
# Specifically, say "hello" to the specified person.
def greet [
        name:string  # The person to greet
    ] {
    echo $"Hello, ($name)!"
}
"""
]

I hope this helps!

from nushell.github.io.

stegrams avatar stegrams commented on July 29, 2024

I hope this helps!

Basically, the upgrade to 0.36 helped a lot 😉.
I admit that I had forgotten how amazing this project is 👍.

I put in config.toml your example on both versions and the bug has gone on the latest.

        Version 0.28.0                    |                Version 0.36.0
                                          |
> greet -h                                | > greet -h
Usage:                                    | Greet a person
  > greet <name> {flags}                  |
                                          | Specifically, say "hello" to the specified person.
Parameters:                               |
  <name> The person to greet              | Usage:
                                          |   > greet <$name> {flags}
Flags:                                    |
  -h, --help: Display this help message   | Parameters:
                                          |   <$name> The person to greet
                                          |
                                          | Flags:
                                          |  -h, --help: Display this help message

In command line, definition description is still ignored in both versions.
Maybe it would be better if there was a way to enclose the custom command in to a pair of scope identifiers, e.g. brackets, in order to signal the REPL processor to wait until the custom command definition ends. And then, to assort the enclosing comments with the command as its documentation.

Though, after the new version, I think this issue, for the most part, is considered closed 👋.

from nushell.github.io.

filaretov avatar filaretov commented on July 29, 2024

Ah, I see, at least it's working now 😄

Questions like this tend to get answered more quickly on the Nu Discord, there's a link on the README on the main repo.

from nushell.github.io.

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.