Skip to content

Commit 4bbf3ff

Browse files
authored
Merge pull request #78 from hardaker/fix-two-dailys-dailies-name
allow both dailys and dailies to work to match public API vs cli API
2 parents 5101419 + ed62a54 commit 4bbf3ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

habitipy/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,15 @@ class CastOnTask(Cast):
589589
"""Casts spells on a task"""
590590
def main(self, *arguments):
591591
super().main()
592-
if len(arguments) != 3 or arguments[1] not in ["todos", "habits", "dailies"]:
592+
if len(arguments) != 3 or arguments[1] not in ["todos", "habits", "dailies", "dailys"]:
593593
self.log.error(_("usage: cast task (todos|habits|dailies) number"))
594594
return
595595

596596
(spell, domain, number) = arguments
597597
number = int(number)
598+
if domain == "dailies":
599+
domain = "dailys" # match what the API expects
600+
598601
tasks = self.api.tasks.user.get(type=domain)
599602

600603
if number > len(tasks):

0 commit comments

Comments
 (0)