progress icon indicating copy to clipboard operation
progress copied to clipboard

Various new CLI options.

Open toofar opened this issue 11 years ago • 3 comments

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.

toofar avatar Jul 13 '14 04:07 toofar

What a huge PR, thanks for all this work ! I will have a look, commit by commit, to all this. Some are very interesting, some would require a few test before validation, and for a few ones, I still need to be convinced, as --globfor instance (I love simple things, and too much CLI switches can give a bad feeling to the user discovering the tool, I think).

Let me have a look to all this, and thanks again.

Xfennec avatar Jul 14 '14 09:07 Xfennec

Is there any way (with git CLI) to cherry pick some of these commits ? (from this branch to the HEAD master) That's something I've never done yet.

Xfennec avatar Jul 18 '14 07:07 Xfennec

Haha, I just looked into this recently (haven't actually done it though). Mostly from this post http://blog.spreedlycom/2014/06/24/merge-pull-request-considered-harmful/. You just add the pr as a new branch (origin pull/ID/head:new-local-branch 1 3) and merge/whatever from there onto master as you please. When you are done (so in the final commit) add "Closes #1234", where 1234 is the pr ID, into the commit message and that should close the pr 2.

toofar avatar Jul 18 '14 08:07 toofar