From 0069a937b01426f30ce024b587eb92bec18e87cd Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 13 Feb 2023 13:51:41 -0600 Subject: [PATCH] docs: add info to remove help about deleting all vivenvs --- src/viv/__main__.py | 4 ++++ src/viv/viv.py | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 src/viv/__main__.py diff --git a/src/viv/__main__.py b/src/viv/__main__.py new file mode 100644 index 0000000..4c4205f --- /dev/null +++ b/src/viv/__main__.py @@ -0,0 +1,4 @@ +from .viv import main + +if __name__ == "__main__": + main() diff --git a/src/viv/viv.py b/src/viv/viv.py index 270d000..4d1b9c8 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -27,7 +27,7 @@ from dataclasses import dataclass from datetime import datetime from itertools import zip_longest from pathlib import Path -from textwrap import wrap +from textwrap import dedent, wrap from typing import Dict, List, Tuple __version__ = "22.12a3" @@ -733,7 +733,12 @@ class Viv: return matches[0] 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: vivenv = self._match_vivenv(name) @@ -813,7 +818,11 @@ class Viv: aliases = kwargs.pop("aliases", [name[0]]) cmd = getattr(self, name) 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)