fix: add some more checks to freeze

This commit is contained in:
Daylin Morgan 2023-05-27 16:48:47 -05:00
parent 28d67d9bed
commit 298e8b274c
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -948,10 +948,13 @@ class Viv:
def freeze(self, args: Namespace) -> None:
"""create import statement from package spec"""
# TODO: warn user about using anything but standalone when
# self.local_source is 'Not Found'
if not args.reqs:
error("must specify a requirement")
sys.exit(1)
error("must specify a requirement", code=1)
if args.path and args.standalone:
error("-p/--path and -s/--standalone are mutually exclusive", code=1)
generate_import(
args.requirements,