Grep-like search within files. Help with -full option to get useful help.
Originally from the code referenced in the article "Rethinking findstr with F# and Powershell". I tweaked the code to bubble up errors, default to not search executable files, provide rudimentary help, and added an option to exclude files by regular expressions.
position 0 required
Regular expression used for matching.
position 1 default '*' comma-separated array
Returns files in current directory matching one or more of the wildcards (not regular expressions).
Example: '*.fs','*.fsx'
comma-separated array
Excludes files matching one or more of the regular expressions (not wild cards).
Example: -exclude '.pdb','.xml'
Recursively search sub-directories.
Include executable files '.exe','.dll' in search.
defalult Encoding.ASCII
I've never tested changing the encoding. Presumably it works.
Makes search case sensitive.
Do not use regex, just do a verbatim string search.
- Annoying that Include takes pattern parameters and Exclude takes regular expressions. Pretty hard to remedy, I think.
- I would like to get the dll-help.xml file working. Helpmessage property in the Parameter attribute is second best.
- Ideas for more F# cmdlets.