Ability to add help informations for a task.
version: "2"
tasks:
"gcloud:docker:push":
desc: Push Docker image to Google cloud registry
help: |
Push Docker image to Google cloud registry.
The env variable "DOCKER_IMAGE_FQN" define the Docker image name to push.
silent: true
cmds:
- cmd: gcloud docker -- push {{.DOCKER_IMAGE_FQN}}
$ task -l
task: Available tasks for this project:
* gcloud:docker:push: Push Docker image to Google cloud registry
$ task help gcloud:docker:push
Push Docker image to Google cloud registry.
The env variable "DOCKER_IMAGE_FQN" define the Docker image name to push
What do you think ?
Hi @skurtzemann! Thanks for the feature request.
I think this proposal makes sense. Since this would be easy to implement, I'll keep this open for potential contributors.
Simplest case: use cobra to add support for the help subcommand.
What do you think, @andreynering?
@skurtzemann I think I'd prefer to keep using pflag as the cli library
I think this should work the same as -l/--list flag, so beside it being a flag, it will work like a command:
task --help my:task:name
I'm not sure pflag allow overwrite the --help flag, though. Otherwise, we'd have to use pflag.Usage instead
I think we can overwrite it then, but if given without any other argument, the behavior should be the same as today
Or, if someone have a better flag name ideia other than --help, I'm open to suggestions, but I couldn't think in any
I think sticking with -h and --help and the semantics that @andreynering suggests sounds like a good suggestion UX wise.
Look for a PR later today. (-0400 GMT.)
Unexpected nephew-sitting is going to push this to tomorrow. The mental work is complete, so the translation to code will be pushed in the morning.
This one look like a good contribution for the first time touching the codebase :)
I would prefer a --details or --info flag for the task because of the collision with --help.
Is it fine if I start going with-details?
WIP Pull Request #180
Should be done? 馃槉
Merging since this is now implemented on master
See: https://taskfile.dev/#/usage?id=display-summary-of-task
Most helpful comment
I think we can overwrite it then, but if given without any other argument, the behavior should be the same as today
Or, if someone have a better flag name ideia other than
--help, I'm open to suggestions, but I couldn't think in any