Comments (3)
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.
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.
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)
- Add crumtrail to command pages.
- [doc] add example for "update/upsert" for powershell HOT 1
- lefthook does not work HOT 3
- Consider moving away from VuePress HOT 3
- Contributor book doesn't have sidebar to navigate HOT 6
- nushell.sh automatically uses http rather than https HOT 2
- Single page view of all docs/book? HOT 1
- Why I can not run `R.exe` in nushell? HOT 2
- Confusing example on script definition order HOT 3
- Generate terminal output HOT 1
- Step value of range is not mentioned in document HOT 1
- A page on control flow HOT 1
- Generate documentation for `std` commands
- Update modules page to disallow empty mod.nu HOT 1
- Issue with terminology in Thinking in Nu page HOT 3
- Add documentation for multi-dot paths HOT 1
- rewrite docs suggestion HOT 10
- Remove `$nothing` from document HOT 1
- Replace std testing with nupm HOT 5
- Explanations in the cheat sheet should come before the code that's explained HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nushell.github.io.