Giter VIP home page Giter VIP logo

Comments (6)

0xTim avatar 0xTim commented on August 15, 2024

@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.

raysarebest avatar raysarebest commented on August 15, 2024

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.

0xTim avatar 0xTim commented on August 15, 2024

@raysarebest yep I think it's a good feature. Concur @gwynne ?

from console-kit.

gwynne avatar gwynne commented on August 15, 2024

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.

raysarebest avatar raysarebest commented on August 15, 2024

Alright, so you (@gwynne) would prefer if I didn't attempt a PR for this?

from console-kit.

gwynne avatar gwynne commented on August 15, 2024

At this point I would tend to consider this superseded by (and thus technically a duplicate of) #180

from console-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.