diff --git a/src/viv/viv.py b/src/viv/viv.py index 8e1abb0..534cc63 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -53,7 +53,7 @@ from typing import ( from urllib.error import HTTPError from urllib.request import urlopen -__version__ = "23.8a1-11-gc453b8f-dev" +__version__ = "23.8a1-12-g6bf2ae4-dev" class Spinner: @@ -1708,18 +1708,26 @@ class Arg: self.kwargs = kwargs +class BoolArg(Arg): + def __init__(self, *args, **kwargs: Any) -> None: + super(BoolArg, self).__init__(*args, action="store_true", **kwargs) + + +class PathArg(Arg): + def __init__(self, *args, **kwargs: Any) -> None: + super(PathArg, self).__init__(*args, metavar="", type=Path, **kwargs) + + class Cli: args = { ("list",): [ - Arg( + BoolArg( flag="verbose", help="pretty print full metadata for vivenvs", - action="store_true", ), - Arg( + BoolArg( flag="quiet", help="show only ids", - action="store_true", ), Arg( flag="filter", @@ -1736,34 +1744,34 @@ class Cli: ), ], ("shim",): [ - Arg( + BoolArg( flag="freeze", help="freeze/resolve all dependencies", - action="store_true", ), - Arg( + PathArg( flag="output", help="path/to/output file", - type=Path, - metavar="", ), ], ("cache_info",): [ - Arg( + BoolArg( flag="path", help="print the absolute path to the vivenv", - action="store_true", ), ], - ("run",): [Arg(flag="script", help="remote script to run", metavar="