notnmeyer / tsk

A really, really simple task runner. Single binary, TOML task format.
MIT License
4 stars 0 forks source link

`--list` display should env vars, or env sources #41

Closed notnmeyer closed 1 year ago

notnmeyer commented 1 year ago

its a little confusing when i see output like,

$ tsk -l
...
[install_release]
  script: scripts/install_release.sh

i recall there are env vars necessary but don't recall exactly. so i look at the script itself and see the env vars, but im not sure which i need to explicitly set.

if --list also showed env var names or dotenv file paths, it would be simpler to understand a task's usage from the list output.

for example,

$ tsk -l
...
[install_release]
  env: version, platform, arch
  script: scripts/install_release.sh

or,

$ tsk -l
...
[install_release]
  dotenv: .env
  script: scripts/install_release.sh

on the fence about whether any existing values should be shown

notnmeyer commented 1 year ago

i think its fine to exclude top level or parent values, since those probably aren't as directly relevant to running the task. but maybe we could also just display them?

$ tsk -l
...
[install_release]
  inherit-parent-env: true
  top-env: blah, blah2
  dotenv: .env
  script: scripts/install_release.sh
notnmeyer commented 1 year ago

came back to this today and it struck me as strange that the output is some half-yaml half-toml abomination. instead, I think we should just re-encode the parsed tasks to toml and display them