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

Priority parsing #120

Open
ghistes opened this issue Feb 3, 2021 · 4 comments
Open

Priority parsing #120

ghistes opened this issue Feb 3, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@ghistes
Copy link

ghistes commented Feb 3, 2021

Hi,

this is a little strange behaviour when adding tasks with priorities:

dstask add P1 P2

this is not accepted but could conceivably be a task named "P2" with priority "P1".

dstask add P1 P3 P2 test

this is accepted (it really should be illegal) but can you guess the resulting priority? It's P2.

@naggie
Copy link
Owner

naggie commented Feb 4, 2021

Yes, the parser will grab the last priority it finds, not the first. I agree it should grab the first leaving the rest as part of the task description.

What version are you running by the way?

@naggie naggie added the bug Something isn't working label Feb 4, 2021
@naggie
Copy link
Owner

naggie commented Feb 4, 2021

Fixed and tested in master. Please re-open if you need to discuss more.

@naggie naggie closed this as completed Feb 4, 2021
@naggie
Copy link
Owner

naggie commented Feb 4, 2021

Actually re-opening -- I did the same for projects, but I;m wondering if we should throw an error if multiple projects or priorities are supplied. I'm not sure yet, as I definitely have wanted to add things that look like a query in the description before.

@naggie naggie reopened this Feb 4, 2021
@dontlaugh
Copy link
Contributor

Definitely some parsing bugs around this.

I propose we allow stuff like this after the -- E.g. allow this (silly) example

task add P3 -- I parked my car on level P1 or was it P2

This currently yields the expected behavior. A task with priority P3 and the summary text "I parked my car on level P1 or was it P2"

But if we add an illegal, non-existent priority, we get a strange result.

% task add P4 -- I parked my car on level P1 or was it P2

Added 63: P4 I parked my car on level or was it P2
[master d074709] Added 63: P4 I parked my car on level or was it P2
 1 file changed, 11 insertions(+)
 create mode 100644 pending/593c64b0-ad10-4b27-8397-a4549be8399e.yml
                                                                                                                                                                                               
0 % task 63
Active context: +personal -someday
Name      Value                                   
ID        63                                      
Priority  P1                                      
Summary   P4 I parked my car on level or was it P2
Status    pending                                 
Project                                           
Tags                                              
UUID      593c64b0-ad10-4b27-8397-a4549be8399e    
Created   2022-03-24 18:52:56.368938538 -0400 EDT 
                                                           

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants