-
-
Notifications
You must be signed in to change notification settings - Fork 763
Description
Description
Summary
The fish completion is broken when colon exists in task description.
Detail
When task descriptions contain colons (:), the fish shell completion breaks due to incorrect sed scripts. Additionally, sed behaves differently across environments, which further complicates the issue. By using fish scripts instead of sed, we can write more robust and maintainable completion scripts.
Environment:
- Task version: v3.41.0
- Fish version: v4.0.0
- OS: Ubuntu 22.04
Steps to Reproduce
The issue can be reproduced using the following Taskfile.yml:
Taskfile.yml
version: "3"
tasks:
command:
desc: "description without a colon."
colon:
desc: "description with a colon: description with a colon."
colon-s:
desc: "description with a colon: and a following space."
command:alias:
desc: "description without a colon, but with aliases."
aliases:
- cma
- cmda
colon:alias:
desc: "description with a colon: and aliases."
aliases:
- cla
- clna
colon-s:alias:
desc: "description with a colon: a following space, and aliases."
aliases:
- clsa
- clnsa
no-desc:
cmd: echo "no description."
no-desc:alias:
aliases:
- nda
- nda2
"task with spaces: and a colon":
desc: "description with spaces."
"task and desc with spaces: and a colon":
desc: "description with spaces: and a colon."Before
- The completions for
colon,colon:alias,colon-s, andcolon-s:aliasare broken. task and desc with spaces: and a colonis also broken.
After
I attempted to fix the issue in my forked repository:
https://github.com/ikura-hamu/task
- The completions for
colon,colon:alias,colon-s, andcolon-s:aliasnow work correctly. - However,
task and desc with spaces: and a colonis still broken. - Additionally,
task with spaces: and a colonis now broken.
Discussion
I believe that tasks with both colons and spaces in their names are rare, as they are inconvenient to type and look somewhat messy in definitions. Therefore, my fix should work well for most users.
Would it be acceptable to merge this fix even though it does not fully resolve the issue for task names containing both spaces and colons? Or would you prefer a more comprehensive solution?
Version
3.41.0
Operating system
Ubuntu 22.04
Experiments Enabled
No response
Example Taskfile
version: "3"
tasks:
command:
desc: "description without a colon."
colon:
desc: "description with a colon: description with a colon."
colon-s:
desc: "description with a colon: and a following space."
command:alias:
desc: "description without a colon, but with aliases."
aliases:
- cma
- cmda
colon:alias:
desc: "description with a colon: and aliases."
aliases:
- cla
- clna
colon-s:alias:
desc: "description with a colon: a following space, and aliases."
aliases:
- clsa
- clnsa
no-desc:
cmd: echo "no description."
no-desc:alias:
aliases:
- nda
- nda2
"task with spaces: and a colon":
desc: "description with spaces."
"task and desc with spaces: and a colon":
desc: "description with spaces: and a colon."
