Describe the bug
Users commonly provide extensions with a leading dot, for example .txt. --ext .txt matches no files even when a.txt exists.
To Reproduce
- Build the current repository:
go build -o /tmp/g-bug-audit .
- Create files with different extensions:
tmp=$(mktemp -d)
touch "$tmp/a.txt" "$tmp/b.csv" "$tmp/noext"
- Filter using a leading-dot extension:
/tmp/g-bug-audit --no-config --disable-index --classic -A --byline --ext .txt "$tmp"
printf 'exit=%s tmp=%s\n' $? "$tmp"
- Actual output:
exit=0 tmp=/var/folders/1b/57vdxmgj7s1glqm6tbsw1frm0000gn/T/tmp.Q85jPTKfgM
- Control check without the leading dot:
/tmp/g-bug-audit --no-config --disable-index --classic -A --byline --ext txt "$tmp"
Actual control output:
a.txt
exit=0 tmp=/var/folders/1b/57vdxmgj7s1glqm6tbsw1frm0000gn/T/tmp.UcazDRUqSl
- Expected output:
--ext .txt should list a.txt, or the CLI should reject the input with a clear validation error.
Screenshots
Not applicable.
Info (please complete the following information):
- OS: macOS darwin/arm64
- Version: v0.31.2, Go go1.26.1
Additional context
The extension filter appears to prepend . to the provided value. If the user already passed .txt, the effective suffix becomes ..txt.
Describe the bug
Users commonly provide extensions with a leading dot, for example
.txt.--ext .txtmatches no files even whena.txtexists.To Reproduce
go build -o /tmp/g-bug-audit ./tmp/g-bug-audit --no-config --disable-index --classic -A --byline --ext txt "$tmp"Actual control output:
--ext .txtshould lista.txt, or the CLI should reject the input with a clear validation error.Screenshots
Not applicable.
Info (please complete the following information):
Additional context
The extension filter appears to prepend
.to the provided value. If the user already passed.txt, the effective suffix becomes..txt.