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

review <number> : number is ignored in some cases #43

Open
mrVanDalo opened this issue Jun 15, 2018 · 6 comments
Open

review <number> : number is ignored in some cases #43

mrVanDalo opened this issue Jun 15, 2018 · 6 comments

Comments

@mrVanDalo
Copy link

mrVanDalo commented Jun 15, 2018

tasksh> review 30

works if 0 is the last element before pressing enter.
but if 0 is followed by a space (or multiple spaces) the number ( 30 ) will be ignored.

@ThomasAdam
Copy link

Which version of tasksh is this? I can't seem to reproduce this, unless I'm being an idiot? With any number, if I do:

review 11 [4 spaces]

or:

review 11 [no spaces here, press enter]

I get the same result.

This is with tasksh version 1.2.0 and 1.3.0.

@mrVanDalo
Copy link
Author

mrVanDalo commented Jun 17, 2018

here a small log :

tasksh                                                              ✔  01:58:41 
tasksh 1.2.0                         

  Commands:
    tasksh> list             Or any other Taskwarrior command
    tasksh> review [N]       Task review session, with optional cutoff after N tasks
    tasksh> exec ls -al      Any shell command.  May also use '!ls -al'
    tasksh> help             Tasksh help
    tasksh> diagnostics      Tasksh diagnostics
    tasksh> quit             End of session. May also use 'exit'

Run 'man tasksh' from your shell prompt.
Run '! man tasksh' from inside tasksh.

tasksh> review 1 
....
End of review. 0 out of 71 tasks reviewed.

tasksh> 

I typed in review 1 [ one space ] [ enter ]

@ThomasAdam
Copy link

OK, I see why. In main.cpp we do this: auto args = split (command, ' '); which really messes with leading and trailing whitespace. Patch to follow to normalise this case, and to handle things like: command foo foo

@mrVanDalo
Copy link
Author

mrVanDalo commented Jun 17, 2018

@ThomasAdam so this is a bug (existing everywhere, not only on my machine) ?

@ThomasAdam
Copy link

Yes, it's a bug.

ThomasAdam added a commit to ThomasAdam/taskshell that referenced this issue Jun 17, 2018
When certain commands in tasksh (such as 'review N') contain whitespace,
such as:

    review '1     '

The whitespace would tokenise into the command arg vector, effectively
treating the whitespace as a literal component.

In the case of the 'review' command, this is undesirable.  Therefore,
strip out all leading/trailing whitespace from the command args vector.

Fixes GH issue GothenburgBitFactory#43
@ThomasAdam
Copy link

Please test the proposed patch which should fix your issue.

ThomasAdam added a commit to ThomasAdam/taskshell that referenced this issue Jun 19, 2018
When certain commands in tasksh (such as 'review N') contain whitespace,
such as:

    review '1     '

The whitespace would tokenise into the command arg vector, effectively
treating the whitespace as a literal component.

In the case of the 'review' command, this is undesirable.  Therefore,
strip out all leading/trailing whitespace from the command args vector.

Fixes GH issue GothenburgBitFactory#43
ThomasAdam added a commit to ThomasAdam/taskshell that referenced this issue Jul 13, 2018
When certain commands in tasksh (such as 'review N') contain whitespace,
such as:

    review '1     '

The whitespace would tokenise into the command arg vector, effectively
treating the whitespace as a literal component.

In the case of the 'review' command, this is undesirable.  Therefore,
strip out all leading/trailing whitespace from the command args vector.

Fixes GH issue GothenburgBitFactory#43
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

No branches or pull requests

2 participants