Skip to content

Commit 87bc518

Browse files
committed
few more little fixes
1 parent e264005 commit 87bc518

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

typer/_click/decorators.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ def option(
2424
*param_decls: str, cls: type["TyperOption"] | None = None, **attrs: Any
2525
) -> Callable[[Command], Command]:
2626
"""Attaches an option to the command. All positional arguments are
27-
passed as parameter declarations to :class:`Option`; all keyword
27+
passed as parameter declarations to `Option`; all keyword
2828
arguments are forwarded unchanged (except ``cls``).
29-
This is equivalent to creating an :class:`Option` instance manually
30-
and attaching it to the :attr:`Command.params` list.
29+
This is equivalent to creating an `Option` instance manually
30+
and attaching it to the `Command.params` list.
3131
32-
For the default option class, refer to :class:`Option` and
33-
:class:`Parameter` for descriptions of parameters.
32+
For the default option class, refer to `Option` and
33+
`Parameter` for descriptions of parameters.
3434
"""
3535
if cls is None:
3636
# avoid circular imports

typer/_click/exceptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def _join_param_hints(param_hint: Sequence[str] | str | None) -> str | None:
1919
class ClickException(Exception):
2020
"""An exception that Click can handle and show to the user."""
2121

22-
#: The exit code for this exception.
2322
exit_code = 1
2423

2524
def __init__(self, message: str) -> None:

typer/_click/shell_completion.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,7 @@ def _start_of_option(ctx: Context, value: str) -> bool:
203203

204204

205205
def _is_incomplete_option(ctx: Context, args: list[str], param: Parameter) -> bool:
206-
"""Determine if the given parameter is an option that needs a value.
207-
208-
:param args: List of complete args before the incomplete value.
209-
:param param: Option object being checked.
210-
"""
206+
"""Determine if the given parameter is an option that needs a value."""
211207
# avoid circular imports
212208
from ..core import TyperOption
213209

typer/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,12 +787,12 @@ def resolve_envvar_value(self, ctx: _click.Context) -> str | None:
787787
def consume_value(
788788
self, ctx: _click.Context, opts: Mapping[str, _click.Parameter]
789789
) -> tuple[Any, _click.core.ParameterSource]:
790-
"""For :class:`Option`, the value can be collected from an interactive prompt
791-
if the option is a flag that needs a value (and the :attr:`prompt` property is
790+
"""For `Option`, the value can be collected from an interactive prompt
791+
if the option is a flag that needs a value (and the `prompt` property is
792792
set).
793793
794794
Additionally, this method handles flag option that are activated without a
795-
value, in which case the :attr:`flag_value` is returned.
795+
value, in which case the `flag_value` is returned.
796796
"""
797797
value, source = super().consume_value(ctx, opts)
798798

0 commit comments

Comments
 (0)