diff --git a/calendar/teachingdates/config/cli.py b/calendar/teachingdates/config/cli.py index 5fc7b8d..c73c272 100644 --- a/calendar/teachingdates/config/cli.py +++ b/calendar/teachingdates/config/cli.py @@ -103,12 +103,21 @@ help="teaching period [required]") parser.add_argument( + "--week-offset", + "-w", + type=int, + default=4, + help="offset to end of week from Monday (where Monday = 0) " + "[default 4 (= Friday)]" + ) + + parser.add_argument( "--year", "-y", type=int, default=datetime.date.today().year, - help=("the year to generate dates for [default {y}]".format( - y=datetime.date.today().year))) + help="the year to generate dates for [default {y}]".format( + y=datetime.date.today().year)) args = parser.parse_args() # normalise format and style @@ -136,6 +145,11 @@ "ignored for 'iso' style".format(prog=PROG)) elif args.style == "lecture": + # --week-offset is irrelevant + if args.week_offset: + args.week_offset = "" + print("{prog}: warning: --week_offset/-w is ignored for 'lecture' " + "style".format(prog=PROG)) # both --paper and --teaching-period are required if not args.paper: parser.exit(