From a350fa30b77ccf55d822399a27a30ce45b2f4166 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sun, 28 May 2023 10:39:15 -0500 Subject: [PATCH] simplify --- src/viv/viv.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index 2268280..6143681 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -52,7 +52,7 @@ from typing import ( from urllib.error import HTTPError from urllib.request import urlopen -__version__ = "23.5a1-17-gb941594" +__version__ = "23.5a1-18-g187f070" class Config: @@ -1164,16 +1164,12 @@ class Viv: # TODO: generalize freeze and this spec generator spec = ", ".join(f'"{req}"' for req in args.reqs) - # TODO: split on version specifier characters... use re? - if len(args.reqs) == 1: - bin = args.reqs[0] - output = c.binparent / args.reqs[0] - else: - if not (args.bin and args.output): - error("please specify an explicit -b/--bin and -o/--output", code=1) + # TODO: split first req on version specifier characters... use re? - bin = args.bin - output = args.output.absolute() + bin = args.reqs[0] if not args.bin else args.bin + output = ( + c.binparent / args.reqs[0] if not args.output else args.output.absolute() + ) if output.is_file(): error(f"{output} already exists...exiting", code=1)