docs: add info to remove help about deleting all vivenvs

This commit is contained in:
Daylin Morgan 2023-02-13 13:51:41 -06:00
parent a3f7bc5437
commit 0069a937b0
2 changed files with 16 additions and 3 deletions

4
src/viv/__main__.py Normal file
View file

@ -0,0 +1,4 @@
from .viv import main
if __name__ == "__main__":
main()

View file

@ -27,7 +27,7 @@ from dataclasses import dataclass
from datetime import datetime from datetime import datetime
from itertools import zip_longest from itertools import zip_longest
from pathlib import Path from pathlib import Path
from textwrap import wrap from textwrap import dedent, wrap
from typing import Dict, List, Tuple from typing import Dict, List, Tuple
__version__ = "22.12a3" __version__ = "22.12a3"
@ -733,7 +733,12 @@ class Viv:
return matches[0] return matches[0]
def remove(self, args): def remove(self, args):
"""remove a vivenv""" """\
remove a vivenv
To remove all viv venvs:
`viv rm $(viv l -q)`
"""
for name in args.vivenv: for name in args.vivenv:
vivenv = self._match_vivenv(name) vivenv = self._match_vivenv(name)
@ -813,7 +818,11 @@ class Viv:
aliases = kwargs.pop("aliases", [name[0]]) aliases = kwargs.pop("aliases", [name[0]])
cmd = getattr(self, name) cmd = getattr(self, name)
parser = subparsers.add_parser( parser = subparsers.add_parser(
name, help=cmd.__doc__, description=cmd.__doc__, aliases=aliases, **kwargs name,
help=cmd.__doc__.splitlines()[0],
description=dedent(cmd.__doc__),
aliases=aliases,
**kwargs,
) )
parser.set_defaults(func=cmd) parser.set_defaults(func=cmd)