diff --git a/cli.js b/cli.js index 51b06dc..1f9f03f 100755 --- a/cli.js +++ b/cli.js @@ -72,6 +72,8 @@ const range = args.filter || null; */ const action = args.kill ? 'kill' : args.action || 'check'; +const permissions = args.permissions || false; + /** * Ensure port is an array for consistent processing. */ @@ -93,7 +95,8 @@ Promise.all( verbose, graceful, filter, - range + range, + permissions }) .then((result) => { verbose && console.log(`Process on port ${action} ${current}`); diff --git a/index.js b/index.js index 1e703b4..26c29bb 100644 --- a/index.js +++ b/index.js @@ -22,6 +22,7 @@ class PortClient { filter = null, range = null, speed = 'safe', + permissions = false } = {}) { this.ports = ports; this.method = method; @@ -83,6 +84,10 @@ class PortClient { return this.handlePorts(selectedPorts); } + if (this.permissions) { + console.log(permissions ? ' sudo' : '') + } + return this.handlePorts(parsedPorts); } diff --git a/package.json b/package.json index bc7aa81..dec6908 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "port-client", - "version": "1.4.5", + "version": "1.4.6", "description": "A powerful utility for managing processes on specified ports, including options for checking port status, killing processes, handling multiple ports, enabling interactive mode, and supporting graceful termination.", "main": "dist/index.js", "scripts": {