Comments (5)
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.
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.
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.
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.
Closing this issue to centralize discussion over to #39.
from cyclopts.
Related Issues (20)
- [BUG]: bad error report because of assetion error when there is UnusedCliTokensError HOT 2
- [BUG] Weird behavior of list of tuples HOT 7
- [BUG] list of tuple of single item is parsed but take only the first character of each token get parsed HOT 2
- Misleading error message when flag name has an underscore HOT 2
- the help format parsing is not consistent HOT 1
- Interactive shell created according to docs also includes shell command HOT 3
- Support in Trogon HOT 3
- Path validator gives misleading error message HOT 12
- Ability to modify default Usage string HOT 4
- Doc string formatting behavior for multi-line comments HOT 8
- Parameter / Command Panel Regression HOT 3
- migration guides? HOT 2
- support for union of None like Optional HOT 3
- App() name parameter type hint adjustment HOT 2
- Docstring hyperlink HOT 11
- [Feature request]: Nested pydantic validation HOT 9
- [Discussion] First-class config overrides via pyproject.toml? HOT 1
- [Feature Request] Completion? HOT 6
- App() console parameter HOT 2
- integration with https://pypi.org/project/typed-settings/ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cyclopts.