Comments (6)
@raysarebest I agree passing some default values via the property wrapper in some format would be a really nice feature. For now, did you know you can do something like https://github.com/vapor/vapor/blob/main/Sources/Vapor/Commands/ServeCommand.swift#L53-L72
from console-kit.
I did, and that's really clean for cases where you wanna do something based on the combined status of many different optionals/properties, but you're still choosing default handling at the call site instead of once when the user input is parsed. If you agree the feature's a good idea, I might open a PR for it this weekend sometime. I'm hoping it'll be relatively straightforward to implement
from console-kit.
@raysarebest yep I think it's a good feature. Concur @gwynne ?
from console-kit.
In theory, yes. In practice I would prefer to encourage adopting ArgumentParser itself, the results of which can then be shunted into ConsoleKit (until I or someone else gets around to formally supporting it and deprecating those parts of ConsoleKit outright).
from console-kit.
Alright, so you (@gwynne) would prefer if I didn't attempt a PR for this?
from console-kit.
At this point I would tend to consider this superseded by (and thus technically a duplicate of) #180
from console-kit.
Related Issues (20)
- Threading issues (raised by --sanitize=thread)
- signature @dynamicMemberLookup
- Create a CLI without a Vapor Application HOT 1
- dynamic command HOT 2
- property wrappers
- Determinate help output ordering HOT 3
- unknown command help
- Property Wrappers look not to work
- Add readme. HOT 1
- Logging improvements. HOT 5
- Corrupt LoadingBar? HOT 1
- Persisting prompts and options HOT 1
- Not compiling for other platforms HOT 3
- Investigate Flaky Tests
- async overload for `Command.run(using context: CommandContext, signature: Signature)`
- Latest version fails to build on Xcode 13.4 HOT 1
- Use ArgumentParser instead of custom solution HOT 2
- AsyncCommand integration with Vapor.Application HOT 2
- Crash when using Secure Input in Docker container for custom Vapor Command HOT 8
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 console-kit.