Skip to content

Zsh/Bash Completion #4923

@norwd

Description

@norwd

Please review the Community Note before submitting

Description

Currently, trufflehog does not have any completion scripts available for modern shells like zsh or bash. This means that you cannot hit tab to complete a flag and instead forces you to add --help to the end of a long command to see the options without loosing the current train of thought.

Preferred Solution

Many (most?) command line tools will come with a completion script that tells the shell what subcommands/flags are available and what type of objects can be used for each of them. For example, --config takes a path, so zsh completion would offer paths relative to the working directory to select a configuration file from. Similarly, --results takes an enum, so hitting tab would make the shell offer --results=verified, --results=unverified, and --results=unknown as options.

Additional Context

I have no experience with bash's completion system (IIRC it's similar to zsh) but zsh's completion system is relatively straightforward but has poor offical documentation. The community-driven @zsh-users GitHub org has several much better resources:

References

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions