mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-13 20:47:53 -06:00
wip: start self
This commit is contained in:
parent
ed8a4458c9
commit
f1b2b14316
1 changed files with 13 additions and 3 deletions
|
@ -49,7 +49,7 @@ from typing import (
|
|||
Generator,
|
||||
)
|
||||
|
||||
__version__ = "22.12a3-41-g5c40210-dev"
|
||||
__version__ = "22.12a3-41-gddb03df-dev"
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -895,11 +895,19 @@ class Viv:
|
|||
|
||||
vivenv.dump_info()
|
||||
|
||||
def self_manage(self, args: Namespace) -> None:
|
||||
"""manage viv installation"""
|
||||
echo("not yet implemented. sorry")
|
||||
|
||||
def _get_subcmd_parser(
|
||||
self, subparsers: _SubParsersAction[ArgumentParser], name: str, **kwargs: Any
|
||||
self,
|
||||
subparsers: _SubParsersAction[ArgumentParser],
|
||||
name: str,
|
||||
attr: Optional[str] = None,
|
||||
**kwargs: Any,
|
||||
) -> ArgumentParser:
|
||||
aliases = kwargs.pop("aliases", [name[0]])
|
||||
cmd = getattr(self, name)
|
||||
cmd = getattr(self, attr if attr else name)
|
||||
parser: ArgumentParser = subparsers.add_parser(
|
||||
name,
|
||||
help=cmd.__doc__.splitlines()[0],
|
||||
|
@ -1009,6 +1017,8 @@ class Viv:
|
|||
parents=[p_vivenv_arg],
|
||||
)
|
||||
|
||||
self._get_subcmd_parser(subparsers, name="self", attr="self_manage")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
args.func(args)
|
||||
|
|
Loading…
Reference in a new issue