Skip to content

Improve --exclude-globs flag location #4473

@AndrewMohawk

Description

@AndrewMohawk

Please review the Community Note before submitting

Description

The help for trufflehog says usage: TruffleHog git [<flags>] <uri> but when trying to use --exclude-flags the position seems to need to be after the file selection. This could definitely be a layer8 issue on my side!

Example:

» trufflehog --log-level=1 --exclude-globs=yarn.lock git file://examples              
trufflehog: error: unknown long flag '--exclude-globs', try --help

» trufflehog --log-level=1 git file://examples --exclude-globs=yarn.lock 
🐷🔑🐷  TruffleHog. Unearth your secrets. 🐷🔑🐷
2025-09-19T14:07:25-07:00	info-1	trufflehog	cloned repo	{"path": "examples"}

Preferred Solution

Allow exclude-globs to be used in the same place as the other flags prior to path spec

Additional Context

I've opened a small PR to add an example for --exclude-globs because its a bit confusing to use:
#4472

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