[Fix] argparse group option not an array

This commit is contained in:
Luís Murta 2022-12-17 20:59:40 +00:00
parent 17d8d5d813
commit 7986fe8e5b
Signed by: satprog
GPG Key ID: 169EF1BBD7049F94

View File

@ -16,14 +16,13 @@ if __name__ == "__main__":
case pfbudget.Operation.CategoryAdd:
assert args.keys() >= {"category", "group"}, "argparser ill defined"
params = [
pfbudget.types.Category(cat, args["group"][0])
for cat in args["category"]
pfbudget.types.Category(cat, args["group"]) for cat in args["category"]
]
case pfbudget.Operation.CategoryUpdate:
assert args.keys() >= {"category", "group"}, "argparser ill defined"
params = [pfbudget.types.Category(cat) for cat in args["category"]]
params.append(args["group"][0])
params.append(args["group"])
case pfbudget.Operation.CategoryRemove:
assert "category" in args, "argparser ill defined"