charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.94k stars 339 forks source link

Use `gum file` to find specific file types/using wildcards to narrow down #669

Closed fearlessgeekmedia closed 2 weeks ago

fearlessgeekmedia commented 3 weeks ago

Is your feature request related to a problem? Please describe. I've created a bash script for Void Linux using gum called xbpsman. One of the things I want to do with it is install packages locally. gum file would theoretically help with this, but I can't search specifically for the .zst file type

Describe the solution you'd like gum file .zst gum file ../.zst for starting in a different directory or maybe something like gum file --type *.zst

or some way to use wildcards to narrow down the files.

Describe alternatives you've considered I can use ls *.txt | gum filter, but then it won't list the directories. And I want it to be able to do that, too.

piero-vic commented 2 weeks ago

I think gum filter **/*.txt should do the trick. Issue #622 also mentions something similar.

fearlessgeekmedia commented 2 weeks ago

That works! Thanks! If there's any documentation on it, I've missed it.