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

clap

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clap - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

35

index.js

@@ -173,3 +173,3 @@ var MAX_LINE_WIDTH = process.stdout.columns || 200;

hot: false,
beforeInit: false,
required: false,

@@ -202,4 +202,8 @@ minArgsCount: 0,

key == 'defValue' ||
key == 'hot')
key == 'beforeInit')
option[key] = opt_1[key];
// old name for `beforeInit` setting is `hot`
if (opt_1.hot)
option.beforeInit = true;
}

@@ -705,6 +709,6 @@ else

// apply hot options
// apply beforeInit options
command.setOptions(
item.options.reduce(function(res, entry){
if (entry.option.hot)
if (entry.option.beforeInit)
res[entry.option.camelName] = entry.value;

@@ -723,3 +727,3 @@ return res;

item.options.reduce(function(res, entry){
if (!entry.option.hot)
if (!entry.option.beforeInit)
res[entry.option.camelName] = entry.value;

@@ -803,2 +807,10 @@ return res;

function args(command){
return command.params.args.map(function(arg){
return arg.required
? '<' + arg.name + '>'
: '[' + arg.name + ']';
}).join(' ');
}
function commandsHelp(){

@@ -811,6 +823,8 @@ if (!command.hasCommands())

var subcommand = command.commands[name];
var line = {
name: chalk.green(name) +
(subcommand.hasOptions() ? ' [<options>]' : '') +
(subcommand._args && subcommand._args.length ? ' [<args>]' : ''),
name: chalk.green(name) + chalk.gray(
(subcommand.params ? ' ' + args(subcommand) : '')
// (subcommand.hasOptions() ? ' [options]' : '')
),
description: subcommand.description_ || ''

@@ -882,4 +896,5 @@ };

chalk.cyan(commandsPath ? commandsPath.join(' ') : command.name) +
(command.hasOptions() ? ' [' + chalk.yellow('<options>') + ']' : '') +
(command.hasCommands() ? ' [' + chalk.green('<command>') + ']' : ''),
(command.params ? ' ' + chalk.magenta(args(command)) : '') +
(command.hasOptions() ? ' [' + chalk.yellow('options') + ']' : '') +
(command.hasCommands() ? ' [' + chalk.green('command') + ']' : ''),
commandsHelp() +

@@ -886,0 +901,0 @@ optionsHelp()

@@ -6,3 +6,3 @@ {

"author": "Roman Dvornov <rdvornov@gmail.com>",
"version": "1.0.7",
"version": "1.0.8",
"keywords": [

@@ -9,0 +9,0 @@ "cli",

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