Skip to content

Auto-provide command line completions #116

@scop

Description

@scop

Currently there are manually written fish shell completions in the repo, and bash completions in a pull request.

I'd suggest switching command line option parsing to a thing that generates them automatically, and for more shells.

For example, https://github.com/spf13/cobra. https://github.com/mitchellh/cli is another alternative. And https://github.com/posener/complete/tree/master directly too (mitchellh/cli uses an earlier v1 version of this), but its "auto install" is in my opinion inferior.

Autogenerating completions to stdout makes it possible for example for bash-completion to load them automatically on demand, like https://github.com/scop/bash-completion/blob/master/completions/_golangci-lint (cobra flavor) or https://github.com/scop/bash-completion/blob/master/completions/_vault (mitchellh/cli flavor) -- we'd add such a snippet for gron if it had it. In such cases people would not have to bother with "installing" the completion files at all, it would Just Work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions