-
Notifications
You must be signed in to change notification settings - Fork 0
/
args.py
44 lines (35 loc) · 1.08 KB
/
args.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import argparse
from config import LR_CATALOG_FILE
from lightroom import FIELD_NAMES_LIST
def parse_arguments():
# Create an argument parser
parser = argparse.ArgumentParser(description="List most used lenses")
# Add an argument for the amount of time to look back
parser.add_argument(
"--lookback",
type=int,
default=365,
help="Number of days to look back (default: 365)",
)
parser.add_argument(
"--property",
type=str,
default="lensName",
choices=[f for f in FIELD_NAMES_LIST if f != "captureTime"],
help="The property to group by (default: lensName)",
)
parser.add_argument(
"--catalog-path",
type=str,
default=LR_CATALOG_FILE,
help=f"The path to the Lightroom catalog file (default: {LR_CATALOG_FILE})",
)
parser.add_argument(
"--picks-only",
action="store_true",
default=False,
help="Count only picks (flagged)",
)
# Parse the command line arguments
args = parser.parse_args()
return args