summaryrefslogtreecommitdiff
path: root/bin/just-lock.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/just-lock.py')
-rwxr-xr-xbin/just-lock.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/just-lock.py b/bin/just-lock.py
index a0e7cfe9..8d292ff1 100755
--- a/bin/just-lock.py
+++ b/bin/just-lock.py
@@ -20,7 +20,7 @@ import subprocess
import sys
import tempfile
-from argparse import ArgumentParser
+from argparse import ArgumentParser, ArgumentError
from pathlib import Path
from typing import Any, Dict, List, NoReturn, Optional, Set, Tuple, Union, cast
@@ -888,7 +888,9 @@ def lock_config(input_file: str) -> Json:
def main():
parser = ArgumentParser(
prog="just-lock",
- description="Generate or update a multi-repository configuration file")
+ description="Generate or update a multi-repository configuration file",
+ exit_on_error=False, # catch parsing errors ourselves
+ )
parser.add_argument("-C",
dest="input_file",
help="Input configuration file",
@@ -909,7 +911,12 @@ def main():
dest="launcher",
help="Local launcher to use for commands in imports",
metavar="JSON")
- args = parser.parse_args()
+
+ try:
+ args = parser.parse_args()
+ except ArgumentError as err:
+ fail("Failed parsing command line arguments with:\n%s" %
+ (err.message, ))
# Get the path of the input file
if args.input_file: