Add email-to-expense skill; expand log_expense.py to accept other/professional-development/software types; update skill index
This commit is contained in:
parent
e7b3084622
commit
20fc0f8d0b
3 changed files with 121 additions and 2 deletions
|
|
@ -95,8 +95,9 @@ def main():
|
|||
note = args[3]
|
||||
files = args[4:]
|
||||
|
||||
if exp_type not in ("meal", "mileage"):
|
||||
print(f"Error: type must be 'meal' or 'mileage', got '{exp_type}'")
|
||||
valid_types = ("meal", "mileage", "other", "professional-development", "software")
|
||||
if exp_type not in valid_types:
|
||||
print(f"Error: type must be one of {valid_types}, got '{exp_type}'")
|
||||
sys.exit(1)
|
||||
|
||||
if exp_type == "meal" and len(files) != 1:
|
||||
|
|
@ -107,6 +108,11 @@ def main():
|
|||
print(f"Error: mileage entries must have exactly 2 files (start + end odometer), got {len(files)}")
|
||||
sys.exit(1)
|
||||
|
||||
# Non-mileage/non-meal types require exactly 1 file
|
||||
if exp_type not in ("meal", "mileage") and len(files) != 1:
|
||||
print(f"Error: {exp_type} entries must have exactly 1 file, got {len(files)}")
|
||||
sys.exit(1)
|
||||
|
||||
if route_stops is not None and exp_type != "mileage":
|
||||
print("Error: --route is only valid for mileage entries")
|
||||
sys.exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue