39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
--- a/lib/tools.py 2021-10-15 08:01:00.000000000 -0500
|
|
+++ a/lib/tools.py 2022-04-06 12:27:07.672427372 -0500
|
|
@@ -37,7 +37,7 @@
|
|
def main(validation_function):
|
|
"""Main function with command line parameter parsing."""
|
|
script_name = os.path.basename(sys.argv[0])
|
|
- usage = "%s [-h] -d|-u csv-file" % (script_name)
|
|
+ usage = "%s [-h] -d|-u|-t csv-file" % (script_name)
|
|
parser = argparse.ArgumentParser(usage=usage)
|
|
|
|
parser.add_argument(
|
|
@@ -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))
|