Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cli-engine-command

Package Overview
Dependencies
Maintainers
4
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-engine-command - npm Package Compare versions

Comparing version 8.0.13 to 8.0.14

lib/color.js

7

lib/command.js

@@ -7,6 +7,2 @@ 'use strict';

var _output = require('./output');
var _output2 = _interopRequireDefault(_output);
var _parser = require('./parser');

@@ -72,4 +68,3 @@

const { CLI } = require('cli-ux');
this.cli = new CLI({ mock: this.config.mock });
this.out = new _output2.default(this.config);
this.out = new CLI({ mock: this.config.mock });
this.http = _httpCall2.default.defaults({

@@ -76,0 +71,0 @@ headers: {

@@ -7,10 +7,6 @@ 'use strict';

var _screen = require('./output/screen');
var _screen = require('./screen');
var _output = require('./output');
var _color = require('./color');
var _output2 = _interopRequireDefault(_output);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function linewrap(length, s) {

@@ -54,18 +50,16 @@ const linewrap = require('@heroku/linewrap');

constructor(config, output) {
constructor(config) {
this.config = config;
this.out = output || new _output2.default(config);
}
command(cmd) {
let color = this.out.color;
let flags = Object.entries(cmd.flags || {}).filter(([name, flag]) => !flag.hidden);
let args = (cmd.args || []).filter(a => !a.hidden);
let hasFlags = flags.length ? ` ${color.blue('[flags]')}` : '';
let usage = `${color.bold('Usage:')} ${this.config.bin} ${buildUsage(cmd)}${hasFlags}\n`;
return [usage, cmd.description ? `\n${color.bold(cmd.description.trim())}\n` : '', this.renderAliases(cmd.aliases), this.renderArgs(args), this.renderFlags(flags), cmd.help ? `\n${cmd.help.trim()}\n` : ''].join('');
let hasFlags = flags.length ? ` ${_color.color.blue('[flags]')}` : '';
let usage = `${_color.color.bold('Usage:')} ${this.config.bin} ${buildUsage(cmd)}${hasFlags}\n`;
return [usage, cmd.description ? `\n${_color.color.bold(cmd.description.trim())}\n` : '', this.renderAliases(cmd.aliases), this.renderArgs(args), this.renderFlags(flags), cmd.help ? `\n${cmd.help.trim()}\n` : ''].join('');
}
commandLine(cmd) {
return [buildUsage(cmd), cmd.description ? this.out.color.dim(cmd.description) : null];
return [buildUsage(cmd), cmd.description ? _color.color.dim(cmd.description) : null];
}

@@ -76,3 +70,3 @@

let a = aliases.map(a => ` $ ${this.config.bin} ${a}`).join('\n');
return `\n${this.out.color.blue('Aliases:')}\n${a}\n`;
return `\n${_color.color.blue('Aliases:')}\n${a}\n`;
}

@@ -83,3 +77,3 @@

return '\n' + renderList(args.map(a => {
return [a.name.toUpperCase(), a.description ? this.out.color.dim(a.description) : null];
return [a.name.toUpperCase(), a.description ? _color.color.dim(a.description) : null];
})) + '\n';

@@ -96,3 +90,3 @@ }

});
return `\n${this.out.color.blue('Flags:')}\n` + renderList(flags.map(([name, f]) => {
return `\n${_color.color.blue('Flags:')}\n` + renderList(flags.map(([name, f]) => {
let label = [];

@@ -104,3 +98,3 @@ if (f.char) label.push(`-${f.char}`);

if (f.required || f.optional === false) description = `(required) ${description}`;
return [` ${label.join(',').trim()}` + usage, description ? this.out.color.dim(description) : null];
return [` ${label.join(',').trim()}` + usage, description ? _color.color.dim(description) : null];
})) + '\n';

@@ -107,0 +101,0 @@ }

@@ -7,4 +7,3 @@ 'use strict';

class Topic {
constructor(commands, out) {
this.out = out;
constructor(commands) {
this.commands = commands;

@@ -11,0 +10,0 @@ }

{
"name": "cli-engine-command",
"description": "base CLI command for cli-engine",
"version": "8.0.13",
"version": "8.0.14",
"author": "Jeff Dickey @dickeyxxx",

@@ -11,16 +11,7 @@ "bugs": "https://github.com/heroku/cli-engine-command/issues",

"cardinal": "1.x",
"chalk": "^1.0.0",
"cli-ux": "^1.0.0",
"chalk": "^2.1.0",
"cli-ux": "^1.0.1",
"fs-extra": "^4.0.1",
"http-call": "^3.0.2",
"lodash.ary": "^4.1.1",
"lodash.defaults": "^4.2.0",
"lodash.get": "^4.4.2",
"lodash.identity": "^3.0.0",
"lodash.keys": "^4.2.0",
"lodash.maxby": "4.x",
"lodash.merge": "4.x",
"lodash.partial": "^4.2.1",
"lodash.property": "^4.4.2",
"lodash.result": "^4.5.2",
"lodash.maxby": "^4.6.0",
"moment": "^2.18.1",

@@ -33,3 +24,3 @@ "string": "3.x",

"babel-eslint": "7.2.3",
"babel-jest": "^21.0.0",
"babel-jest": "^21.0.2",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",

@@ -39,3 +30,3 @@ "babel-plugin-transform-class-properties": "6.24.1",

"babel-plugin-transform-flow-strip-types": "6.22.0",
"cli-engine-config": "^3.1.6",
"cli-engine-config": "^3.2.0",
"eslint": "^4.6.1",

@@ -45,3 +36,3 @@ "eslint-config-standard": "10.2.1",

"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jest": "^21.0.0",
"eslint-plugin-jest": "^21.0.2",
"eslint-plugin-node": "^5.1.0",

@@ -54,3 +45,3 @@ "eslint-plugin-promise": "3.5.0",

"husky": "^0.14.3",
"jest": "^21.0.1",
"jest": "^21.0.2",
"jest-junit": "^3.0.0",

@@ -57,0 +48,0 @@ "lint-staged": "^4.1.3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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