Fleet stop with fields and regex parameters

Fleet stop with fields and regex parameters


npm install -g fleet-stopregex


fleet-stopregex --field [command, commit, pid] <regex> <regex flags>

The script matches the regular expression against the specified all field for every spawned process. For any process which matches, that process is then killed

If field is omitted then pid will be used as the default.

Note that --field is aliased to -f, therefore fleet-stopregex --field command = fleet-stopregex -f command


Stop PID Same as vanilla fleet-stop. However fleet-stopregex will retry the stop command until it succeeds

fleet-stopregex pid#b0a13c

By Git Commit Stop all processes which have an exact commit

fleet-stopregex --field commit fbdcfba04752fe6f42be6e49461b8d2dec63c31e

Regex Flags Flags can be passed as optional last parameter. This flags are the same as you would pass to new RegExp(pattern, flags).

# stop processes with name both foo or Foo
fleet-stopregex --field command foo i

Stop everything Pass a "." as the regex which will match everything

fleet-stopregex .

Note that * will not work as regex string unless it is quoted as "*"

# Good
fleet-stopregex "*"
# Bad
fleet-stopregex *