nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.4k stars 58 forks source link

Display the default value of args in help #126

Closed DevOpsCraftsman closed 1 year ago

DevOpsCraftsman commented 1 year ago

Thanks for this absolutely wonderful lib!

Would it be possible to display the default value of an args in the help?

Example:

    [tool.poe.tasks.load]
    help = "Load base data"
    control.expr = "pack"

        [[tool.poe.tasks.load.args]]
        name = "pack"
        options = ["-p", "--pack"]
        help = "The amount of fixtures needed"
        default = "full"

        ...

Now the help displays:

  load           Load base data
    -p, --pack   The amount of fixtures needed

It would be useful to add this:

    -p, --pack   The amount of fixtures needed [Default: full]

I could write it by hand, but using directly the default is more DRY.

Thanks!

nat-n commented 1 year ago

Hi @yahya-abou-imran, Thanks for the feedback :)

I think this is a good idea. I'd like to overhaul how documentation works at some point to make it more detailed, but this is a step in the right direction. Feel free to submit a PR, otherwise I'll add it when I next have some time.

nat-n commented 1 year ago

@yahya-abou-imran This was shipped in 0.19.0 🙂