Skip to content

Commit 2a287e3

Browse files
Niloth-ptimabbott
authored andcommitted
google-calendar: Clean up add_argument parameters.
- Removed add_argument() parameters set to default values. - Renamed `dest` of calendarID to calendar_id, in order to make flag names uniform, in preparation for adding support for loading them from a config file. - Cleared up spacing, and made minor clarifications to `help`.
1 parent 48d0506 commit 2a287e3

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

zulip/integrations/google/google-calendar

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,18 @@ usage = r"""google-calendar --user EMAIL [--interval MINUTES] [--calendar CALEND
5050
"""
5151

5252
parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage))
53-
54-
5553
parser.add_argument(
5654
"--interval",
57-
dest="interval",
5855
default=30,
5956
type=int,
60-
action="store",
6157
help="Minutes before event for reminder [default: 30]",
62-
metavar="MINUTES",
6358
)
64-
6559
parser.add_argument(
6660
"--calendar",
67-
dest="calendarID",
61+
dest="calendar_id",
6862
default="primary",
69-
type=str,
70-
action="store",
71-
help="Calendar ID for the calendar you want to receive reminders from.",
63+
help="The ID of the calendar you want to receive reminders from. By default, the primary calendar is used.",
7264
)
73-
7465
options = parser.parse_args()
7566

7667
if not options.zulip_email:
@@ -108,7 +99,7 @@ def populate_events() -> Optional[None]:
10899
feed = (
109100
service.events()
110101
.list(
111-
calendarId=options.calendarID,
102+
calendarId=options.calendar_id,
112103
timeMin=now,
113104
maxResults=5,
114105
singleEvents=True,

0 commit comments

Comments
 (0)