Show help for custom subcommands by default if parent command is not defined
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 40.5k
- Forks
- 2.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 85
Description
Related problem
Imagine I want to define new commands that are actually subcommands for non-existing command
def 'service start' () {}
def 'service stop' () {}
Calls to service start, service stop will work fine, but call to service will fail with No such file.
In order to provide some guide when calling service I can define parent command with next code:
def service () {
help service
}
And with that after calling service I'll get the help for subcommands
Describe the solution you'd like
Provide default parent command that will show help message if some of subcommands were provided. In case the parent command is defined, use it instead of default.
Describe alternatives you've considered
I can implement that manually every time I define subcommands, but this will be tedious.
Additional context and details
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Nushell's custom subcommand resolution for calls such as service start and the existing help service behavior. Define the fallback behavior when service has subcommands but no parent command, while preserving an explicitly defined parent command, and verify both cases with focused command-dispatch tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, shell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100