Closed theclapp closed 7 months ago
Rationale: I use expand.Fields to do filename expansion, for which I'd like to do case-insensitive matching. E.g. I'd like "c*" to match both "cmd" and "CHANGELOG.md"
Can you give some context in terms of when is this useful for a shell? I see nocaseglob
in man bash
, which alone is probably enough to need this Go API, but I wonder if your need comes from elsewhere.
I have an terminal/shell app that uses this package as its shell interpreter. It also, as mentioned in this PR, uses expand.Fields to do filename expansion, like bash does when you press tab. So I'd like c
This is similar to if you set shopt -s nocaseglob
in bash and type "c*
Would you like me to add the "nocaseglob" shopt and make it set this flag?
OK gotcha, makes sense. If you want to wire it up to the interpreter that would be nice as a way to make this change a bit more well rounded and get the easy win, but it's not a must. I'll review later.
I added the nocaseglob
shopt, force-pushed, and updated the title and description of the PR.
Rationale: I use expand.Fields to do filename expansion, for which I'd like to do case-insensitive matching. E.g. I'd like "c*" to match both "cmd" and "CHANGELOG.md"