Skip to content

Commit

Permalink
Add --silent flag (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammster authored and sindresorhus committed Oct 16, 2018
1 parent 9b27f86 commit 3550899
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const cli = meow(`
Options
--force -f Force kill
--verbose -v Show process arguments
--silent -s Silently kill and always exit with code 0
Examples
$ fkill 1337
Expand All @@ -39,6 +40,10 @@ const cli = meow(`
verbose: {
type: 'boolean',
alias: 'v'
},
silent: {
type: 'boolean',
alias: 's'
}
}
});
Expand Down Expand Up @@ -153,6 +158,10 @@ if (cli.input.length === 0) {

if (!cli.flags.force) {
promise.catch(error => {
if (cli.flags.silent) {
return;
}

if (/Couldn't find a process with port/.test(error.message)) {
console.error(error.message);
process.exit(1);
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $ fkill --help
Options
--force -f Force kill
--verbose -v Show process arguments
--silent -s Silently kill and always exit with code 0
Examples
$ fkill 1337
Expand Down

0 comments on commit 3550899

Please sign in to comment.