Comments (4)
Ah yes, I forgot about usage.
I'll do this two-fold:
-
Improve the current usage to be more consistent with other libraries (the current was a bit of a lazy place holder).
-
Allow manual override via a supplied string
usage="My Usage"
. -
Allow disabling it via supplying an empty string.
from cyclopts.
@BrianPugh would it not be more consistent with the general patterns of python (and this project) to use None for the disabling component? Just a thought :)
Also, great work with this project, I was a heavy user of Typer before I came across this in one of the issues as a resolution to an issue that Typer has refused to fix for years. I'll be raising some ideas in here myself soon ❤️
from cyclopts.
In Cyclopts, None
always resolves to "default behavior", which is also a common python pattern. Typically, the default behavior is to "derive data from some source." Frequently, the defaults can be overridden with a user-provided string, so an Optional[str]
type makes sense. Finally, what if the user want's to disable a feature? A natural extension of this is the manual override of an empty string.
When a user-provided str
value doesn't make sense (e.g. show_env_var
), a bool
is a natural choice.
from cyclopts.
closing with the release of v2. We can reopen this issue, or open a new one, should the need arise.
I'll work on improving the default usage string to be at parity with other tools like argparse/click/typer in the near future.
from cyclopts.
Related Issues (20)
- 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
- [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
- Misc likely (rare) typing bugs HOT 1
- Use of the meta application results in a double help display HOT 5
- Automatic conversion from underscore to hyphen HOT 3
- Prompt for missing required parameters HOT 6
- Newlines should not be present in descriptions that span multiple lines HOT 4
- [Feature Request] Add auto_env_var_prefix HOT 7
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.