Comments (4)
This is an interesting issue. The library was originally designed to be agnostic about the help system. Before the previous release, it was simply another command. This is an important usability problem, so we'll probably need more special casing for help.
from airline.
+1 for fixing this issue. If you want to continue to be agnostic to the help system the the Errors object pattern might be a better approach than throwing. Especially when dealing with input from a user which may actually have multiple things wrong with it, this pattern will allow for the reporting of each problem at once rather than failing once at a time.
You could still keep the current semantic you have today with:
MyCommand command = SingleCommand.singleCommand(MyCommand.class).parseFailFast(args);
But then you could also support a model like this:
ParseResult parseResult = new ParseResult();
MyCommand command = SingleCommand.singleCommand(MyCommand.class).parse(args, parseResult);
if (parseResult.hasErrors()) {
command.helpOption.showHelpWithErrors(parseResult.errors());
}
Thoughts?
from airline.
Seems this fix never goes into the master branch here: https://github.com/airlift/airline Is there any reason?
from airline.
Any updates on this one?
from airline.
Related Issues (20)
- help to include allowedValues, and respect multi-line descriptions
- Show default values when showing help HOT 1
- Version 0.7 requires Java 1.7
- Update README.md for latest 0.7 (currently says 0.6) HOT 1
- Dependency on guava HOT 4
- --help breaks when using required options when using singleCommand() HOT 3
- Automatically show help when user types invalid command? HOT 2
- Does not compile HOT 5
- ParseArgumentsUnexpectedException although following usage HOT 1
- Interactive command line HOT 2
- Conflicting arguments, although they don't conflict HOT 1
- NPE when running "help" when argument is marked as hidden
- Feature Request: Support for Kotlin types
- Information about Inheritance and Composition HOT 2
- Upgrade to Guava 24.1+ HOT 7
- ParseOptionConversionException is not transporting the cause HOT 2
- group-aware help
- Cli.commandFactory is never used?
- Allow mutually exclusive required options HOT 5
- Java Server Overloaded
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 airline.