41 lines
1.4 KiB
Diff
41 lines
1.4 KiB
Diff
diff --git a/lib/tools.py b/lib/tools.py
|
|
index 2ab74f7f..a3d52620 100644
|
|
--- a/lib/tools.py
|
|
+++ b/lib/tools.py
|
|
@@ -49,7 +49,7 @@ def get_csv_dict_reader(filename: str) -> csv.DictReader:
|
|
|
|
def main(validation_function):
|
|
"""Main function with command line parameter parsing."""
|
|
- parser = argparse.ArgumentParser(usage="%(prog)s [-h] -d|-u csv-file")
|
|
+ parser = argparse.ArgumentParser(usage="%(prog)s [-h] -d|-u|-t csv-file")
|
|
|
|
parser.add_argument(
|
|
"-d",
|
|
@@ -56,15 +56,24 @@
|
|
default=False,
|
|
help="validate an Ubuntu CSV file",
|
|
)
|
|
+ parser.add_argument(
|
|
+ "-t",
|
|
+ "--trisquel",
|
|
+ dest="trisquel",
|
|
+ action="store_true",
|
|
+ default=False,
|
|
+ help="validate a Trisquel CSV file")
|
|
parser.add_argument("csv_file", metavar="csv-file", help="CSV file to validate")
|
|
|
|
args = parser.parse_args()
|
|
- if len([x for x in [args.debian, args.ubuntu] if x]) != 1:
|
|
- parser.error("You have to select exactly one of --debian, --ubuntu.")
|
|
+ if len([x for x in [args.trisquel, args.debian, args.ubuntu] if x]) != 1:
|
|
+ parser.error("You have to select exactly one of --trisquel, --debian, --ubuntu.")
|
|
|
|
if args.debian:
|
|
distro = "debian"
|
|
- else:
|
|
+ elif args.ubuntu:
|
|
distro = "ubuntu"
|
|
+ else:
|
|
+ distro = "trisquel"
|
|
|
|
return int(not validation_function(args.csv_file, distro))
|