diff options
author | rillig <rillig@pkgsrc.org> | 2022-02-06 18:04:50 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2022-02-06 18:04:50 +0000 |
commit | ba64732d3c46a70ff903f563b7edc0c419a41c23 (patch) | |
tree | 4b28d165c8b9026cc72ca1efd5f0c6ce5f04ba17 /pkgtools | |
parent | 67e89aed1b3e202d44578e267611af52786d1cf2 (diff) | |
download | pkgsrc-ba64732d3c46a70ff903f563b7edc0c419a41c23.tar.gz |
url2pkg: only accept a single URL as command line argument
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/url2pkg/files/url2pkg.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.py b/pkgtools/url2pkg/files/url2pkg.py index 96763007ad6..64fa6fcc0ea 100644 --- a/pkgtools/url2pkg/files/url2pkg.py +++ b/pkgtools/url2pkg/files/url2pkg.py @@ -1,5 +1,5 @@ #! @PYTHONBIN@ -# $NetBSD: url2pkg.py,v 1.37 2022/02/06 18:00:08 rillig Exp $ +# $NetBSD: url2pkg.py,v 1.38 2022/02/06 18:04:50 rillig Exp $ # Copyright (c) 2019 The NetBSD Foundation, Inc. # All rights reserved. @@ -1226,7 +1226,7 @@ def main(argv: List[str], g: Globals): except getopt.GetoptError: usage() - url = args[0] if args else usage() + url = args[0] if len(args) == 1 else usage() if not re.fullmatch(r'\w+://[!-~]+?/[!-~]+', url): sys.exit(f'url2pkg: invalid URL: {url}') |