diff --git a/jaraco/develop/add-project.py b/jaraco/develop/add-project.py index 247c665..397874d 100644 --- a/jaraco/develop/add-project.py +++ b/jaraco/develop/add-project.py @@ -4,8 +4,10 @@ import operator import subprocess +from typing_extensions import Annotated import path +import typer import jaraco.text from jaraco.ui.main import main @@ -19,7 +21,10 @@ def add_newlines(lines): @main -def run(name: str, target: path.Path = path.Path()): +def run( + name: str, + target: Annotated[path.Path, typer.Option(parser=path.Path)] = path.Path(), +): repo, path = git.projects_repo() project = git.Project.parse(name) with git.temp_checkout(repo, quiet=True): diff --git a/jaraco/develop/checkout-all.py b/jaraco/develop/checkout-all.py index 00e155d..68b0a93 100644 --- a/jaraco/develop/checkout-all.py +++ b/jaraco/develop/checkout-all.py @@ -1,14 +1,17 @@ import functools +from typing_extensions import Annotated import path +import typer from more_itertools import consume + from jaraco.ui.main import main from . import git @main -def run(target: path.Path = path.Path()): +def run(target: Annotated[path.Path, typer.Argument(parser=path.Path)] = path.Path()): checkout = functools.partial(git.checkout_missing, root=target) consume(map(checkout, git.projects())) diff --git a/newsfragments/+dc04d32d.bugfix.rst b/newsfragments/+dc04d32d.bugfix.rst new file mode 100644 index 0000000..cc1abbe --- /dev/null +++ b/newsfragments/+dc04d32d.bugfix.rst @@ -0,0 +1 @@ +Fix usage when soliciting a path.Path, which typer doesn't support. \ No newline at end of file