Comments (7)
Hi, thank you.
Do you have a use case for this?
Ideally we would want to have error messages so good that they won't need to be replaced, so if you have a suggestion how it should look, I'm all ears.
Technically it's not too hard to implement but I'd like to figure out what are the pros/cons.
from clifx.
I have three things that bother me right now:
- I think the argument type mismatch is too vague; it does not REALLY tell the user what went wrong. It tells the technical description of what went wrong (could not convert) but I think it should instead inform the user what was expected, e.g.
The value 'abc' for option 'id' is invalid; it must be an integer
. - I want to wrap the CLI in a batch script so I can call it using
myprogram command subcommand args
instead ofdotnet MyProgram.dll command subcommand args
. The help text uses the latter format which I cannot change. - I don't like the background color on the headers (Usage, Options, etc.), but that is a more of a subjective matter 😉
from clifx.
- Fair enough. The type names are kinda generic because you can use options of any time, but we can make special cases for base types.
- You can change it using
.WithExecutableName()
onCliApplicationBuilder
. It's impossible to know that it was launched from a batch file unfortunately. - The colors actually look different in different terminals. I assume you don't like how it looks in cmd?
from clifx.
You can change it using .WithExecutableName() on CliApplicationBuilder. It's impossible to know that it was launched from a batch file unfortunately.
Nice, exactly what I was looking for (it is UseExecutibleName()
actually).
The colors actually look different in different terminals. I assume you don't like how it looks in cmd?
I use Cmder with a custom color scheme, but it has more to do with me not being a fan of background colors I guess.
I think the standard outputs that you have made are generally fine, but it would be nice to be able to customize them to one's own needs. I am not suggesting it is something you have to do as a consumer, but it would be nice to have the option.
from clifx.
Nice, exactly what I was looking for (it is UseExecutibleName() actually).
Oops.
from clifx.
Removed the background color on headers.
Also changed the errors in case of conversion failure, but they're still a bit technical.
from clifx.
Updated the error messages again. I'll be continually improving them to make them sound better. Closing this for now as I don't think I will be adding custom formatting.
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.