Skip to content

Commit

Permalink
Change: Allow to pass --year and --changed for update-header CLI
Browse files Browse the repository at this point in the history
--year is the fallback of --changed if the year of the last git
modification can't be calculated. Therefore it should be allowed to be
set in conjunction with --changed.
  • Loading branch information
bjoernricks committed Feb 26, 2024
1 parent 74ea568 commit 91ce1f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pontos/updateheader/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def parse_args(args: Optional[Sequence[str]] = None) -> Namespace:
help="Activate logging using the given file path",
).complete = shtab.FILE # type: ignore[attr-defined]

date_group = parser.add_mutually_exclusive_group()
date_group.add_argument(
parser.add_argument(
"-c",
"--changed",
action="store_true",
Expand All @@ -51,7 +50,7 @@ def parse_args(args: Optional[Sequence[str]] = None) -> Namespace:
"determined via git it falls back to --year."
),
)
date_group.add_argument(
parser.add_argument(
"-y",
"--year",
default=str(datetime.now().year),
Expand Down

0 comments on commit 91ce1f6

Please sign in to comment.