You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, just want to thank you for tusk! It's been a pleasure to use and is now a main component of my workflow. With upcoming go run support in 1.17.x for import paths it can run bash style via a shebang.
#!/usr/bin/env -S go run github.com/rliebz/[email protected] -f
---
tasks:
hello:
run:
- echo world
My feature request is for "variadic style" tasks, that is, the ability to define a task with an arbitrary number of options and/or arguments, similar to this example: https://gobyexample.com/variadic-functions
My use-case for this is I often define tasks as a wrapper of sorts for another program, such as this example for kind
#!/usr/bin/env -S go run github.com/rliebz/[email protected] -f
---
tasks:
kind:
run:
- go run sigs.k8s.io/kind@latest
./tusk.yaml kind runs kind but in order to pass arguments and options I would need to define them all. For non user-exposed tasks i've been using global options which works well enough
However it would be handy to be able to expose a command that just passes everything through, this way tasks could be easily defined as a proxy of sorts for a program
---
options:
kind:
default: go run sigs.k8s.io/kind@latesttasks:
kind:
options: anyargs: anyrun:
- ${kind} ${options} ${args}
This could enable easily using a task like it was the original program without needing to define everything
We also use tusk mostly to wrap other tools. However, from my point of view, this suggestion is problematic, because perhaps one of the most useful feature of tusk over other tools is the explicit declaration of options, including very good auto-completion and the possibility to write usage strings. This ensures that the task file is self-descriptive, needs minimal documentation, and is easy to use for multiple team members.
Allowing a variadic pass-through, espcially when it comes to options is encoring a pattern that favors simple tusk files over usability, which in my own opinion, is removing most of the benefits of using tusk in the first place. If this is how most tasks will look like, you might consider a shell script.
Allowing the last listed argument to be variadic though (similar to Go functions) is probably a nice thought, if not one I have often seen a need for.
First of all, just want to thank you for
tusk
! It's been a pleasure to use and is now a main component of my workflow. With upcominggo run
support in 1.17.x for import paths it can run bash style via a shebang.My feature request is for "variadic style" tasks, that is, the ability to define a task with an arbitrary number of options and/or arguments, similar to this example: https://gobyexample.com/variadic-functions
My use-case for this is I often define tasks as a wrapper of sorts for another program, such as this example for
kind
./tusk.yaml kind
runskind
but in order to pass arguments and options I would need to define them all. For non user-exposed tasks i've been using global options which works well enoughHowever it would be handy to be able to expose a command that just passes everything through, this way tasks could be easily defined as a proxy of sorts for a program
This could enable easily using a task like it was the original program without needing to define everything
Interested in your thoughts on this, thanks again!
The text was updated successfully, but these errors were encountered: