Coder Social home page Coder Social logo

Not the centre of the application about clikt HOT 6 CLOSED

ajalt avatar ajalt commented on May 12, 2024
Not the centre of the application

from clikt.

Comments (6)

ajalt avatar ajalt commented on May 12, 2024

I agree that NoRunCliktCommand is not a great name. I'm open to suggestions.

I'm not sure why you want to access the option objects. You can just retrieve the parsed values through the delegate properties.

class Tool: NoRunCliktCommand() {
    val opt by option()
}

fun main(args: Array<String>) {
    val tool = Tool()
    tool.parse(args)
    println("opt value=${tool.opt}")
}

from clikt.

dhakehurst avatar dhakehurst commented on May 12, 2024

from clikt.

ajalt avatar ajalt commented on May 12, 2024

I'm still not sure I understand. Can you give me a more concrete example of what you're trying to do?

from clikt.

ajalt avatar ajalt commented on May 12, 2024

I'm going to close due to inactivity. We can reopen this if there are any updates.

from clikt.

dhakehurst avatar dhakehurst commented on May 12, 2024

I simply want a function like
findOption(name:String) : Option
that accesses the _options property

is it a problem to provide it ?

from clikt.

ajalt avatar ajalt commented on May 12, 2024

I don't want to expose implementation details without a concrete use case, but you could always keep track of that yourself:

val cmd = NoOpClickCommand()
val o1 = cmd.option() // not using delegate, need to register manually
cmd.registerOption(o1)
val options = mapOf("o1" to o1)

from clikt.

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.