Repository navigation
Parser rewrite 2 #3924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Parser rewrite 2 #3924
Changes from all commits
af64958
50b6889
6ca1f70
7e2545f
23c6b93
73686c2
51054b8
d77c32b
9016a2b
5fa30a1
733b6f7
e08755d
c12397b
0fde8db
4e32cda
0ba0f95
1ef22c0
73a6ad0
9fc187d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,25 @@ | ||
| ## Version 8.6.0 | ||
| ## Version 9.0.0 | ||
|
|
||
| Unreleased | ||
|
|
||
| - The old parser, deprecated in 8.2, is removed. {meth}`Command.parse_args` | ||
| parses arguments directly. {issue}`2205` | ||
|
|
||
| - `OptionParser` is removed from `click` and `click.parser`, along with | ||
| `click.parser.Option`, `Argument`, `ParsingState`, `normalize_opt`, and | ||
| `split_opt`. `split_arg_string` is available as | ||
| {func}`click.split_arg_string`. | ||
| Use `optparse` from the standard library if you need the old parser. | ||
| - `Command.make_parser` and `Parameter.add_to_parser` are removed. | ||
|
Rowlando13 marked this conversation as resolved.
Resolved
|
||
| - `Context.protected_args` always returns an empty list. The subcommand | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You simply tell that
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will change. |
||
| name and its arguments are in `Context.args`. | ||
| - Better error messages when parsing fails. | ||
|
|
||
| - Option names that only become equal after `token_normalize_func`, such as | ||
| `-v` and `-V` with a lower-casing function, raise a `TypeError` when parsing | ||
| instead of one silently making the other unreachable. This includes the on | ||
| and off names of a boolean flag, such as `-s/-S`. | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will add tests for this. And add note. I was not aware this was incidentally fixed. |
||
| - Drop support for Python 3.10. {pr}`3920` {pr}`3921` | ||
| - A parameter name that is not a valid Python identifier, or that is a Python | ||
| keyword, is deprecated and raises `TypeError` in Click 9.0. {pr}`3866` | ||
|
|
||
|
Rowlando13 marked this conversation as resolved.
Resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Private utilities that must not import anything else from the package. Keeping | ||
| # them dependency-free lets any module use them without creating circular imports. | ||
| # This module will also be used to help unwind circular imports in core.py. | ||
| from __future__ import annotations | ||
|
|
||
|
|
||
| def _split_opt(opt: str) -> tuple[str, str]: | ||
| """Splits an option into a prefix and a value.""" | ||
| first = opt[:1] | ||
| if first.isalnum(): | ||
| return "", opt | ||
| if opt[1:2] == first: | ||
| return opt[:2], opt[2:] | ||
| return first, opt[1:] |
Uh oh!
There was an error while loading. Please reload this page.