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

@oclif/core

Package Overview
Dependencies
Maintainers
2
Versions
406
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oclif/core - npm Package Compare versions

Comparing version 3.26.9 to 3.27.0

7

lib/help/command.js

@@ -157,8 +157,3 @@ "use strict";

if (flag.type === 'option') {
let value = flag.helpValue || (this.opts.showFlagNameInTitle ? flag.name : '<value>');
if (!flag.helpValue && flag.options) {
value = showOptions || this.opts.showFlagOptionsInTitle ? `${flag.options.join('|')}` : '<option>';
}
if (flag.multiple)
value += '...';
let value = docopts_1.DocOpts.formatUsageType(flag, this.opts.showFlagNameInTitle ?? false, this.opts.showFlagOptionsInTitle ?? showOptions);
if (!value.includes('|'))

@@ -165,0 +160,0 @@ value = chalk_1.default.underline(value);

1

lib/help/docopts.d.ts

@@ -63,2 +63,3 @@ import { Command } from '../command';

constructor(cmd: Command.Loadable);
static formatUsageType(flag: Command.Flag.Any, showFlagName: boolean, showOptions: boolean): string;
static generate(cmd: Command.Loadable): string;

@@ -65,0 +66,0 @@ toString(): string;

@@ -76,2 +76,23 @@ "use strict";

}
static formatUsageType(flag, showFlagName, showOptions) {
if (flag.type !== 'option')
return '';
let helpValues;
if (flag.helpValue) {
// if there is a given helpValue, use it
helpValues = typeof flag.helpValue === 'string' ? [flag.helpValue] : flag.helpValue;
}
else if (flag.options) {
// if there are options, show them if wanted
helpValues = [showOptions ? flag.options.join('|') : '<option>'];
}
else if (showFlagName) {
helpValues = [flag.name];
}
else {
// default to <value>
helpValues = ['<value>'];
}
return helpValues.map((v) => `${v}${flag.multiple ? '...' : ''}`).join(' ');
}
static generate(cmd) {

@@ -97,3 +118,3 @@ return new DocOpts(cmd).toString();

return name;
return `${name}=<value>`;
return `${name}=${DocOpts.formatUsageType(flag, false, true)}`;
}));

@@ -128,3 +149,3 @@ }

if (flag.type === 'option') {
type = flag.options ? ` ${flag.options.join('|')}` : ' <value>';
type = ` ${DocOpts.formatUsageType(flag, false, true)}`;
}

@@ -131,0 +152,0 @@ const element = `${flagName}${type}`;

@@ -201,3 +201,3 @@ import { Command } from '../command';

type: 'option';
helpValue?: string;
helpValue?: string | string[];
options?: readonly string[];

@@ -204,0 +204,0 @@ multiple?: boolean;

{
"name": "@oclif/core",
"description": "base library for oclif CLIs",
"version": "3.26.9",
"version": "3.27.0",
"author": "Salesforce",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/core/issues",

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