Xfennec/cv — pull request #13 by toofar (2014-07-13 04:18:13+00:00)
Title: Various new CLI options.

First of all sorry for having everything on the master branch, I got a bit carried away. If you would prefer to have logical changes on separate branches, github style, I have no problem with that. It will have to wait for tomorrow though, I figure I should take a break before I end up implementing pretty colours or something.

These changes a bunch of new command line options for: matching/filtering filehandles based on directory, case insensitively and file size; matching/filtering processes based on full command line and using wildcards.
It also allows multiple commands (`-c`) and directories (`-D`) to be specified at once using commas as delimiter (eg `cv -c firefox,wget`). Also there is one (premature) optimisation: go through `/proc` once and try each of the commands for each pid rather than going through `/proc` for each command.

-V --verbose print non-exceptional errors (eg permission denied)
-g --glob use fnmatch() when matching process names instead of strcmp()
-f --full match against the entire command line instead of just the command name, implies --glob
Note that this is an exact match, use -g and \*pattern\* to get a substring match
-i --case-insensitive match case insensitively
-D --directory dir filter results to processes handling files in dir, comma separated
-S --size bytes filter results to processes handling files larger than bytes

PS: The diff below may look bigger than it actually is but a bunch of stuff just changed indentation.