Comments (3)
When you put it like that, the difference between A and B makes a lot of sense...
Thank you for your responsiveness and the new release.
👍
from clize.
Hi, thanks for update.
I dont know if it is related (and maybe it is 'normal') but i also found this "problem" :
Using description WITH alternate command list won't works
Using previously typed code :
# CASE A -> OK
run(echo, version, build_date, description="""
test description
""")
# CASE B -> Not OK
run(echo, alt=[version, build_date], description="""
test description
""")
Case B provide error :
Traceback (most recent call last):
File "/home/user/MyPyProjs/Py390/CliTests/venv/lib/python3.9/site-packages/clize/runner.py", line 172, in get_cli
cli = obj.cli
AttributeError: 'function' object has no attribute 'cli'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/MyPyProjs/Py390/CliTests/./clize_t01.py", line 53, in <module>
run(echo, description="""
File "/home/user/MyPyProjs/Py390/CliTests/venv/lib/python3.9/site-packages/sigtools/modifiers.py", line 161, in __call__
return self.func(*args, **kwargs)
File "/home/user/MyPyProjs/Py390/CliTests/venv/lib/python3.9/site-packages/clize/runner.py", line 381, in run
cli = Clize.get_cli(fn, **kwargs)
File "/home/user/MyPyProjs/Py390/CliTests/venv/lib/python3.9/site-packages/clize/runner.py", line 175, in get_cli
cli = cls(obj, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'description'
from clize.
Hello!
Nothing apparently, that must've been a long-standing bug, even though the feature was documented. I've added tests to ensure this never breaks again.
https://github.com/epsy/clize/releases/tag/v5.0.1 fixes this, you can grab the updated version using pip (pip install --upgrade clize
)
Regarding your second issue, this is not unexpected, though it could be clearer:
- In case A, you have multiple commands to pick from, so there is a
description=
parameter available for run() so that you can provide a description. - In case B, you have one command with a few alternates. The main command's docstring can provide the description, so no
description=
argument is accepted.
I'll see tomorrow if the error message can be made more explicit about this. Thanks for reporting the issue.
from clize.
Related Issues (20)
- Use `Annotated` to add aliases to options HOT 4
- Any way to give negative number as argument ? HOT 1
- `typing.List[str]` not supported by Clize
- [Question] Disable print(), if --help HOT 1
- Case-sensitive 1-character aliases are not allowed HOT 2
- How to support custom types and typing? HOT 4
- Support for Google Style Python Docstrings HOT 1
- make pathlib.Path a first citizen by adding default converter HOT 4
- Add intro for `repeated_test` in contribution guidelines
- KeyError when decorator rewrites varargs HOT 1
- Docs do not mention setup or setup.py
- Is this project still alive? HOT 1
- Missing 4.1.1 release HOT 1
- Requesting support for automatic shell completion
- Allow the creation of command aliases HOT 4
- Any issue with `attrs>=20.0.0`? HOT 2
- Proposing a PR to fix a few small typos
- repeated_test no longer compatible with 3.10 HOT 2
- What is going wrong here? 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 clize.