Git Product home page Git Product logo

Comments (5)

kbknapp avatar kbknapp commented on May 30, 2024

This may get dropped as I'm not sure toml is the best way to represent an app structure unless it's dynamically generated somehow...TBD

from clap.

vks avatar vks commented on May 30, 2024

I'm not sure toml is the best way to represent an app structure unless it's dynamically generated somehow...

What exactly is the problem? TOML allows nesting as well, but keeps it flat:

subcommands:
    - subcmd:
        about: demos subcommands from yaml
        version: "0.1"
        author: Kevin K. <[email protected]>
        args:
            - scopt:
                short: B
                multiple: true
                help: example subcommand option
                takes_value: true
            - scpos1:
                help: example subcommand positional
                index: 1

would be

[subcommands.subcmd]
about = "demos subcommands from yaml"
version = "0.1"
author = "Kevin K. <[email protected]>"

[subcommands.args.scopt]
short = "B"
multiple = true
help = "example subcommand option"
takes_value = true

[subcommands.args.scpos1]
help = "example subcommand positional"
index = 1

from clap.

kbknapp avatar kbknapp commented on May 30, 2024

@vks it's not that it doesn't support it, it's that unless you're dynamically generating that, it would be a pain to write. YAML on the other hand pretty short and easy to read / mentally parse. Granted that a personal opinion, and if it's not shared I'd be happy to merge TOML support as well...I just don't have the bandwidth right now to add it 😜

from clap.

vks avatar vks commented on May 30, 2024

@kbknapp I think if we used serde we would get both YAML and TOML (and others).

from clap.

kbknapp avatar kbknapp commented on May 30, 2024

Potentially yes, I haven't worked with serde in quite a while, so I'd have to hit the books again to see how much work it'd be. I'm not opposed to it by any means, other than I'd like to keep these features working on stable and not have to require nightly.

from clap.

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.