Raynes / fs

File system utilities for Clojure.
453 stars 119 forks source link

Add support for case insentivity in glob search pattern #58

Closed biggert closed 11 years ago

biggert commented 11 years ago

Note that this allows for a global mode modifier at the beginning of the pattern. It does not add support for individual mode modifiers scatterred throughout the pattern.

biggert commented 11 years ago

I'll admit to this being a bit primitive. I'm not emotionally connected to the way this was implemented... I just need this feature ASAP so feel free to do it in a better way if possible.

noprompt commented 11 years ago

I'm not sure how others would feel, but if it were me ignore-case? would be an explicit option (ie. :ignore-case? true) instead of a silent one. That would make the API clear and remove the parsing step.

biggert commented 11 years ago

I can't disagree with that... my initial approach was to use an option! I was conflicted though because regular expressions support this functionality within them and since this function takes a regular expression, I felt like that might be a more natural place for regex experts to use it... but myself being a light user of regex, I would agree that having an explicit argument is certainly a valid alternative.

Raynes commented 11 years ago

I really don't want to do much of anything else to the glob stuff. It's really not a great idea to even have that thing. In my experience, if you're using this half-assed implementation of globs you should probably be using a real shell instead.

Thanks for the pull request though! If I add any new features to the glob function this will be one of them. Doubt that's going to happen though.