Skip to content

bash-completion #43

@daniel-baumann

Description

@daniel-baumann

Hi,

it would be very nice if nerdlog would have a bash-completion, so that one can use 'tab-tab' to help with "toggling" through the nerdlog command-line options.

There are two common ways of doing it:

a) completely manual - means I'd write the bash-completion file for the current version, send a pull request which would statically ship that file alongside of the nerdlog binary (like a manpage), and with every subsequent nerdlog version the bash-completion file needs to be manually updated for any changes in nerdlog. obviously this is rather cumbersome in the long run.

b) automatically generated - nerdlog could implement the output of the bash-completion file from within the nerdlog binary, using the internal option handling which will make it always be in sync with the actual options available in nerdlog itself.
people usually do something like 'nerdlog --bash-completion' or so, which then outputs the snipped to stdout, so package maintainers run during build something like 'nerdlog --bash-completion > /usr/share/bash-completion/completions/nerdlog'.

For python, there's arg_parse and for rust there's clap_complete that does this exactly this automatically. I guess there must be something for Go too :)

While I can provide the manually crafted bash-completion file for a), I don't know anything about Go so I don't feel comfortable comming up with a patch for b).

Nothing important - but I though I'll bring it up..

Regards,
Daniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions