Comments (5)
Hey, thanks a lot! Glad you're enjoying it.
It's currently not possible to trigger help manually, although I have an idea how to implement it.
To understand your scenario a bit better, is your code available on GitHub or somewhere else I could take a look at? Or maybe you can give me a more applied example which involves real command names, etc?
from clifx.
Here's a really simple example repo I created:
https://github.com/domn1995/HelpTextExample
Current output
>app command1
>
>app command1 sub1
Doing work...
As you can see, the output of the first command is blank. I would like to show the help text there instead.
Desired output
>app command1
Usage
app command1 [command]
Options
-h|--help Shows help text.
Commands
sub1
You can run `app command1 [command] --help` to show help on a specific command.
>app command1 sub1
Doing work...
Essentially, since command1
doesn't actually do any work, it just "organizes" the command line structure, I would like to show its help text when no arguments are given to make it clear to the user that this command doesn't really do anything.
If this is a feature that you believe would benefit the project, I would love to submit a PR. Just point me in the right direction.
Cheers!
from clifx.
My first idea is to extend the CommandException
with an extra parameter ShowHelp
, which would get inspected by CliApplication
. Then you would be able to do:
[Command("docker container")]
public class ContainerCommand : ICommand
{
public ValueTask ExecuteAsync(IConsole consonle) =>
throw new CommandException("Please specify a command.", showHelp: true);
}
from clifx.
I like it. Do you want me to create a new issue for the feature and submit a PR?
from clifx.
Sure, go ahead.
from clifx.
Related Issues (20)
- Add IConsole.Clear()
- Separation of model from business logic HOT 7
- Check `BindingConverter<T>` and `BindingValidator<T>` types in analyzers
- Executable name does not appear in help text in some terminals HOT 4
- How do you wrap help output? HOT 1
- Add multi-language output message support HOT 5
- Command examples HOT 3
- Drop support for targets below net5.0 HOT 11
- Positional arguments listed out-of-order when inheriting from base command class HOT 2
- ConsoleWriter is not thread-safe HOT 1
- `IConsole.ReadKey` should return the key that was read HOT 1
- Support `=` (equal sign) as value separator in argument syntax HOT 4
- Assembly binding confusion results in many AD0001 analyzer warnings HOT 11
- `FakeInMemoryConsole.Clear()` has no effect HOT 4
- Capturing Trace and Debug output HOT 1
- Default `IsRequired` for options based on whether the `required` modifier is used on the property
- CliFx.Analyzers produces hundreds of CS8032 warnings in build HOT 9
- Publishing an exe as "PublishSingleFile=true" with version 2.3.4 fails HOT 2
- Calling commands from other rcommands HOT 3
- Allow the non scalar parameter to be optional or have default value HOT 4
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 clifx.