Socket
Socket
Sign inDemoInstall

cmdln

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmdln - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

46

CHANGES.md

@@ -7,2 +7,48 @@ # node-cmdln Changelog

## 7.0.0
- [Backward incompatible change] This changes the formatting of "error info" --
a feature introduced in v6.0.0. There are two changes:
1. Error info is now always rendered via `JSON.stringify`. Previously
that was only done if `showErrStack`. This deals with an issue where
the other rendering would result in, e.g., `res: [object Object]`
if the info value was an Object.
2. Indentation has been increased.
Before v7.0.0 example:
```
$ mytool list
mytool list: error: 3 errors:
error gathering rebalancer-agent info on storage inst 70521b69-4c31-469b-b120-00d7e2300517
error gathering rebalancer-agent info on storage inst 887bb8e7-5117-4173-a9a3-6499ab10651c
error gathering rebalancer-agent info on storage inst 20e480c9-fb66-4a64-8d92-c2f89e496da1
res: [object Object]
```
With v7.0.0 example:
```
$ mytool list
mytool list: error: 3 errors:
error gathering rebalancer-agent info on storage inst 20e480c9-fb66-4a64-8d92-c2f89e496da1
error gathering rebalancer-agent info on storage inst 887bb8e7-5117-4173-a9a3-6499ab10651c
error gathering rebalancer-agent info on storage inst 70521b69-4c31-469b-b120-00d7e2300517
error info:
{
"res": {
"uuid": "cc9ad6da-e05e-11e2-8e23-002590c3f078",
"hostname": "S12612523509075",
"zonename": "20e480c9-fb66-4a64-8d92-c2f89e496da1",
"service": "storage",
"result": {
"exit_status": 2,
"stdout": "edfeb9c7-1c22-41ca-ab17-b8c3bfdf8037\nnot-frobbed\n",
"stderr": "bash: line 33: syntax error: unexpected end of file\n"
}
}
}
```
## 6.0.0

@@ -9,0 +55,0 @@

23

lib/cmdln.js
/*
* Copyright 2019 Trent Mick
* Copyright 2019 Joyent, Inc.
* Copyright 2020 Trent Mick
* Copyright 2020 Joyent, Inc.
*/

@@ -1600,15 +1600,8 @@

if (Object.keys(errInfo).length !== 0) {
if (showErrStack) {
errDetails +=
'\n error info:\n' +
indentLines(JSON.stringify(errInfo, null, 4));
} else if (showErrInfo) {
errDetails +=
'\n' +
Object.keys(errInfo)
.map(function onK(k) {
return ' ' + k + ': ' + errInfo[k];
})
.join('\n');
}
errDetails +=
'\n error info:\n' +
indentLines(
JSON.stringify(errInfo, null, 4),
' '
);
}

@@ -1615,0 +1608,0 @@ }

{
"name": "cmdln",
"version": "6.0.0",
"version": "7.0.0",
"description": "helper lib for creating CLI tools with subcommands; think `git`, `svn`, `zfs`",

@@ -5,0 +5,0 @@ "author": "Trent Mick (http://trentm.com)",

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