Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default value to get command #20

Closed
wants to merge 1 commit into from

Conversation

dotKuro
Copy link
Contributor

@dotKuro dotKuro commented Jun 13, 2020

I set the default for the get command to "state:open" as stated in #18

@dotKuro
Copy link
Contributor Author

dotKuro commented Jun 13, 2020

Just ignore the last two commits. The first one should be pushed to another branch and the second one just reverts the first one. 🙈

Copy link
Owner

@ad-si ad-si left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work. Filter expressions are anded, so it's not possible to overwrite it the way you implemented it. tl get state:open AND state:done makes not sense.
It must be implemented somewhere in the runFilter function or similar

@dotKuro
Copy link
Contributor Author

dotKuro commented Jun 13, 2020

No tl get state:done works perfectly using this method.

The parser looks for at least one string argument other whise it will fail. The <|> provides an alternaitve in case the parser fails. Which means it will either use any arguemnt provided (i.e tl get state:done) or when no arguemnt is provided (tl get) it will use state:open instead.

Is that what was meant with the todo? I might got it wrong.

@ad-si
Copy link
Owner

ad-si commented Jun 13, 2020

Ah ok, sorry, didn't properly read the code.

But this means that tl get would list all open tasks like tl open.
I think I'd prefer that it shows the help text if the filter expressions is misssing:

$ tl get
Missing: FILTER_EXP

Usage: tasklite get FILTER_EXP
  Get all tasks filtered by the specified expressions by priority

@dotKuro
Copy link
Contributor Author

dotKuro commented Jun 13, 2020

This is exactly the behaviour upstream has currently.

I propably missunderstood the todo.

(40gs) Use state:open per default for the tl get command

What was this suppose to mean? If you not specify state: after get it should always implicitly use state:open?

@ad-si
Copy link
Owner

ad-si commented Jun 13, 2020

If a filter without a state expression is specified
then add expression state:open
else (there is no filter) show help message

@ad-si
Copy link
Owner

ad-si commented Oct 19, 2020

Added in 826aa99.
Thanks a lot for the PR!

@ad-si ad-si closed this Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants