Skip to content

Conversation

@thejray
Copy link
Contributor

@thejray thejray commented Feb 19, 2020

This fixes bash autocompletion that fails by producing an extra colon at the end of completions. Note that there is a similar sed for colon removal already present in the zsh autocomplete

It also removes an unnecessary sed 's/^\* //' in favor of just using print $2 in the awk command.

@iquiw
Copy link

iquiw commented Feb 20, 2020

How about using one awk command?

task -l  | awk 'NR > 1 { sub(/:$/, "", $2); print $2 }'

Or one sed ?

task -l  | sed -n '1d; s/^\* \([^ ]*\):.*/\1/p'

(These are not equivalent. The latter needs : to exist, the former does not.)

@thejray thejray requested a review from andreynering February 20, 2020 21:04
@thejray
Copy link
Contributor Author

thejray commented Feb 20, 2020

@iquiw I leave it up to the maintainers. The PR I have is a small delta to fix a specific bug, and I do not think performance matters here.

@andreynering
Copy link
Member

Hi @thejray,

Thanks a lot!

@andreynering andreynering merged commit e0defe7 into go-task:master Mar 1, 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.

3 participants