Socket
Socket
Sign inDemoInstall

command-line-tool

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

command-line-tool - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

22

lib/command-line-tool.js

@@ -42,6 +42,8 @@ 'use strict'

* @param [options] {object}
* @param [options.stack] {boolean} - defaults to false
*/
printError (err) {
/* detect whether operational or programmer error, and display stack if latter */
console.error(ansi.format(t.isString(err) ? err : err.stack, 'red'))
printError (err, options) {
options = options || {}
const msg = t.isString(err) ? err : options.stack ? err.stack : err.message
console.error(ansi.format(msg, 'red'))
}

@@ -55,2 +57,3 @@

* @param [options.exitCode] {number} - defaults to 1
* @param [options.stack] {boolean} - defaults to false
*/

@@ -63,3 +66,3 @@ halt (err, options) {

} else {
this.printError(err)
this.printError(err, options)
}

@@ -75,10 +78,2 @@ }

definitions = arrayify(definitions)
if (!definitions.some(where({ name: 'help' }))) {
definitions.push({
name: 'help',
alias: 'h',
type: Boolean,
description: 'Print usage information.'
})
}
const commandLineArgs = require('command-line-args')

@@ -96,5 +91,2 @@ const commandLineUsage = require('command-line-usage')

}
if (options.help || (options._all && options._all.help)) {
this.stop(this.usage)
}
return options

@@ -101,0 +93,0 @@ }

{
"name": "command-line-tool",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "0.3.1",
"version": "0.4.0",
"description": "command-line-tool",

@@ -22,3 +22,3 @@ "repository": "https://github.com/75lb/command-line-tool.git",

"command-line-args": "^3.0.0",
"command-line-usage": "^3.0.1",
"command-line-usage": "^3.0.3",
"test-value": "^2.0.0",

@@ -30,3 +30,3 @@ "typical": "^2.4.2"

"jsdoc-to-markdown": "^1.3.6",
"tape": "^4.5.1"
"tape": "^4.6.0"
},

@@ -33,0 +33,0 @@ "standard": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc