Git Product home page Git Product logo

Comments (6)

asarkar avatar asarkar commented on May 29, 2024 2

+1 for example. Let's consider the README:

class MyArgs(parser: ArgParser) {
    val verbose by parser.flagging("-v", "--verbose",
                                   help = "enable verbose mode")

    val name by parser.storing("-w", "--widget-name",
                               help = "name of the widget")

    val size by parser.storing("-s", "--size",
                               help = "size of the plumbus") { toInt() }
}

Questions I've as soon as I see this:

  1. How do I instantiate an ArgParser?
  2. How do I provide default values?
  3. Great, I've made a class MyArgs. I still don't see how to use it for parsing args array.
  4. No, I don't want to dig through unit tests and source code. You're claiming easy-to-use.

See, why examples are great?

from kotlin-argparser.

xenomachina avatar xenomachina commented on May 29, 2024

This is a good idea.

I probably won't have a chance to put up a full example for a couple of days, but Googling for "site:github.com kotlin-argparser -inurl:kotlin-argparser" turns up a few examples.

from kotlin-argparser.

aneksamun avatar aneksamun commented on May 29, 2024

+1: Finding help no working for me

from kotlin-argparser.

lucasvsme avatar lucasvsme commented on May 29, 2024

@dsully @aneksamun Check the pull request #28 in case you still need a working sample.

from kotlin-argparser.

nbhanji avatar nbhanji commented on May 29, 2024

I have searched google for examples -- cannot find. Declaring a class MyArgs and no underpinning on how to use in main part, that is kind of losing the point of making it easy. Can you please provide at least general or even getting help to print on screen.

Thanks.

from kotlin-argparser.

xenomachina avatar xenomachina commented on May 29, 2024

Thanks for your patience, everyone. I agreed from the start that a complete example would be great, but didn't have the time to put one together earlier, and I wasn't sure how to best "package" it.

I finally got around to making one. You can find it here: kotlin-argparser-example

It's in a separate repo because I didn't want it to rely on any complex gradle magic, and I wanted it to be an easy starting point for someone to just copy the entire thing and start working, if they so choose. (The latter is also why it uses Unlicense.) I've linked to it from the readme.

I hope you find it useful.

from kotlin-argparser.

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.