Coder Social home page Coder Social logo

Comments (5)

BrianPugh avatar BrianPugh commented on May 16, 2024

Keep the issues coming! I appreciate you using CYclopts, and It's easier to make larger changes at the beginning of a project :D.

To be concrete, would the proposed output look like:

$ python .\test.py --help
Usage: cli [ARGS] [OPTIONS]

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────╮
│ PATH           directory or file [default: C:\Users\raven\Documents\GitHub\testtesttest]             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Parameters ─────────────────────────────────────────────────────────────────────────────────────────╮
│ --config       config file [default: C:\Users\raven\Documents\GitHub\testtesttest\config.yaml]       │
│ --version      Display application version.                                                          │
│ --help     -h  Display this message and exit.                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯

I suppose the issue is, where would a POSITIONAL_OR_KEYWORD argument go?

from cyclopts.

Ravencentric avatar Ravencentric commented on May 16, 2024

To be concrete, would the proposed output look like:

yes

I suppose the issue is, where would a POSITIONAL_OR_KEYWORD argument go?

obvious answer would be a third box maybe? but will it go in between or last? will it be too much clutter?

Another option would just be rolling POSITIONAL_OR_KEYWORD into the Parameters box in the help screen to encourage users to use keyworded args where possible, since too many positional arguments get confusing real quick and more prone to mistakes (my personal preference would be this)

from cyclopts.

BrianPugh avatar BrianPugh commented on May 16, 2024

So I think this could work (where config is POSITIONAL_OR_KEYWORD). I'm worried that it might too heavily encourage the use of POSITIONAL_ONLY values. In most of my CLI applications, I primarily use POSITIONAL_OR_KEYWORD or KEYWORD_ONLY, but I rarely use POSITIONAL_ONLY.

╭─ Arguments ────────────────────────────────────────────────────────────────────────────────────────────╮
│ PATH           directory or file [default: C:\Users\raven\Documents\GitHub\testtesttest]               │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Parameters ───────────────────────────────────────────────────────────────────────────────────────────╮
│ CONFIG,--config  config file [default: C:\Users\raven\Documents\GitHub\testtesttest\config.yaml]       │
│ --version        Display application version.                                                          │
│ --help     -h    Display this message and exit.                                                        │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯

from cyclopts.

Ravencentric avatar Ravencentric commented on May 16, 2024

that looks good, conveys config is both without being too much clutter

From my experience, usually CLIs usually have atmost one or two positional only args, with the rest mostly being keyword only or keyword_or_positional. And for keyword_or_positional i usually explicitly do keyword to avoid any mistakes.

from cyclopts.

BrianPugh avatar BrianPugh commented on May 16, 2024

Closing this issue to centralize discussion over to #39.

from cyclopts.

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.