insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.32k stars 314 forks source link

gcalcli add gives error... You must only specify a single calendar #482

Closed uxcn closed 2 months ago

uxcn commented 5 years ago

I've tried adding --default-calendar=Personal to .gcalclirc and specifying gcalcli --calendar=Personal add; neither fixes the error. I even tried gcalcli --noincluderc --default-calendar=Personal --calendar=Personal.

The same happens with quick

My .gcalclirc looks similar to this...

--default-calendar=Personal
--calendar=Personal#white
--calendar=Contacts\' birthdays and events#blue
--calendar=Holidays in United States#white

Here is my version information...

gcalcli v4.1.1 (Eric Davis, Brian Hartvigsen, Joshua Crowgey)
jcrowgey commented 5 years ago

Can you try v4.2.0 (just released to pypi last week)? That release addressed some issues with how you specify a calendar. I'd like to find out how this affects your bug report.

uxcn commented 5 years ago

With version 4.2.0, instead of the error I get a prompt to pick which calendar to add the event to, which works. Adding using quick still seems to give the same error though.

Is there any way to use --calendar or --default-calendar to choose the calendar to add the event to on the command line?

jcrowgey commented 5 years ago

When you use 4.2.0 and you see the prompt to pick a calendar when you use add, does the string "Personal" appear in your calendar prompt? Would you mind posting your terminal session (with any sensitive details redacted) so that I can see the interaction? I've tended to use email addresses as names for google calendars so I'm curious to see how the "Personal" tag you're using is set up. Maybe it's enough just to show us the output of gcalcli list and then add.

uxcn commented 5 years ago

Yes.

(jason@pi) [3214] ~git/uxcn/yafd gcal
 Access  Title
 ------  -----
  owner  Earnings
  owner  Bills
  owner  Taxes (Io)
  owner  Fed
  owner  BELUG
  owner  Personal
  owner  Bills (Io)
 reader  Super GT
 reader  LM: WEC - FIA World Endurance Championship
 reader  LM: European Le Mans Series
 reader  Rally: WRC - FIA World Rally Championship
 reader  GSLUG
 reader  WTCR: FIA World Touring Car Cup
 reader  DTM
 reader  Rally: ERC - FIA European Rally Championship
 reader  Contacts
 reader  Holidays in United States

(jason@pi) [3215] ~git/uxcn/yafd gcaa
Title: Test
Location: Test
When: 2019-09-28 09:00
Duration (minutes): 60
Description: Test
Enter a valid reminder or "." to end: 30
Enter a valid reminder or "." to end: .
0 Personal
1 Bills
2 Earnings
3 Fed
4 Bills (Io)
5 Taxes (Io)
6 BELUG
Specify calendar from above: 0
mjuarezm commented 5 years ago

same issue here

jcrowgey commented 5 years ago

Well, a least a prompt to pick is better than the crash. Still, as your report suggests, setting the default calendar ought to work. Thank you for the report.

uxcn commented 5 years ago

Adding via quick still fails.

dbarnett commented 2 months ago

Adding via quick still fails.

Alright, I've merged #702 to fix the quick command to prompt the same way.

Might consider defaulting these selections to the --default-calendar or some similar option in the future, but given that the help for --default-calendar says "to use if no --calendar options are given", IMO it's better to keep behavior more conservative and prompt when there are multiple calendars passed to add, even if one of them came from --default-calendar.