Socket
Socket
Sign inDemoInstall

@rushstack/ts-command-line

Package Overview
Dependencies
Maintainers
3
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/ts-command-line - npm Package Compare versions

Comparing version 4.19.5 to 4.20.0

21

dist/ts-command-line.d.ts

@@ -61,6 +61,9 @@ /**

/* Excluded from this release type: _buildParser */
/* Excluded from this release type: _execute */
/* Excluded from this release type: _executeAsync */
/* Excluded from this release type: _getArgumentParser */
/**
* Your subclass should implement this hook to perform the operation.
*
* @remarks
* In a future release, this function will be renamed to onExecuteAsync
*/

@@ -634,3 +637,3 @@ protected abstract onExecute(): Promise<void>;

*
* If your caller wants to trap and handle errors, use {@link CommandLineParser.executeWithoutErrorHandling}
* If your caller wants to trap and handle errors, use {@link CommandLineParser.executeWithoutErrorHandlingAsync}
* instead.

@@ -641,7 +644,15 @@ *

*/
executeAsync(args?: string[]): Promise<boolean>;
/**
* @deprecated Use {@link CommandLineParser.executeAsync} instead.
*/
execute(args?: string[]): Promise<boolean>;
/**
* This is similar to {@link CommandLineParser.execute}, except that execution errors
* This is similar to {@link CommandLineParser.executeAsync}, except that execution errors
* simply cause the promise to reject. It is the caller's responsibility to trap
*/
executeWithoutErrorHandlingAsync(args?: string[]): Promise<void>;
/**
* @deprecated Use {@link CommandLineParser.executeWithoutErrorHandlingAsync} instead.
*/
executeWithoutErrorHandling(args?: string[]): Promise<void>;

@@ -879,2 +890,4 @@ /* Excluded from this release type: _registerDefinedParameters */

* is enabled.
*
* In a future release, this will be renamed to `getCompletionsAsync`
*/

@@ -1140,3 +1153,3 @@ completions?: () => Promise<string[]>;

/* Excluded from this release type: _processParsedData */
/* Excluded from this release type: _execute */
/* Excluded from this release type: _executeAsync */
/* Excluded from this release type: _registerDefinedParameters */

@@ -1143,0 +1156,0 @@ /**

@@ -116,2 +116,4 @@ import type { SCOPING_PARAMETER_GROUP } from '../Constants';

* is enabled.
*
* In a future release, this will be renamed to `getCompletionsAsync`
*/

@@ -118,0 +120,0 @@ completions?: () => Promise<string[]>;

2

lib/providers/AliasCommandLineAction.js

@@ -146,3 +146,3 @@ "use strict";

async onExecute() {
await this.targetAction._execute();
await this.targetAction._executeAsync();
}

@@ -149,0 +149,0 @@ }

@@ -55,3 +55,3 @@ import type * as argparse from 'argparse';

*/
_execute(): Promise<void>;
_executeAsync(): Promise<void>;
/**

@@ -64,2 +64,5 @@ * {@inheritDoc CommandLineParameterProvider._getArgumentParser}

* Your subclass should implement this hook to perform the operation.
*
* @remarks
* In a future release, this function will be renamed to onExecuteAsync
*/

@@ -66,0 +69,0 @@ protected abstract onExecute(): Promise<void>;

@@ -65,3 +65,3 @@ "use strict";

*/
_execute() {
_executeAsync() {
return this.onExecute();

@@ -68,0 +68,0 @@ }

@@ -308,3 +308,3 @@ import * as argparse from 'argparse';

/**
* This is called internally by {@link CommandLineParser.execute}
* This is called internally by {@link CommandLineParser.executeAsync}
* @internal

@@ -314,3 +314,3 @@ */

/**
* This is called internally by {@link CommandLineParser.execute} before `printUsage` is called
* This is called internally by {@link CommandLineParser.executeAsync} before `printUsage` is called
* @internal

@@ -320,3 +320,3 @@ */

/**
* This is called internally by {@link CommandLineParser.execute}
* This is called internally by {@link CommandLineParser.executeAsync}
* @internal

@@ -323,0 +323,0 @@ */

@@ -359,3 +359,3 @@ "use strict";

/**
* This is called internally by {@link CommandLineParser.execute}
* This is called internally by {@link CommandLineParser.executeAsync}
* @internal

@@ -370,3 +370,3 @@ */

/**
* This is called internally by {@link CommandLineParser.execute} before `printUsage` is called
* This is called internally by {@link CommandLineParser.executeAsync} before `printUsage` is called
* @internal

@@ -381,3 +381,3 @@ */

/**
* This is called internally by {@link CommandLineParser.execute}
* This is called internally by {@link CommandLineParser.executeAsync}
* @internal

@@ -384,0 +384,0 @@ */

@@ -81,3 +81,3 @@ import type * as argparse from 'argparse';

*
* If your caller wants to trap and handle errors, use {@link CommandLineParser.executeWithoutErrorHandling}
* If your caller wants to trap and handle errors, use {@link CommandLineParser.executeWithoutErrorHandlingAsync}
* instead.

@@ -88,7 +88,15 @@ *

*/
executeAsync(args?: string[]): Promise<boolean>;
/**
* @deprecated Use {@link CommandLineParser.executeAsync} instead.
*/
execute(args?: string[]): Promise<boolean>;
/**
* This is similar to {@link CommandLineParser.execute}, except that execution errors
* This is similar to {@link CommandLineParser.executeAsync}, except that execution errors
* simply cause the promise to reject. It is the caller's responsibility to trap
*/
executeWithoutErrorHandlingAsync(args?: string[]): Promise<void>;
/**
* @deprecated Use {@link CommandLineParser.executeWithoutErrorHandlingAsync} instead.
*/
executeWithoutErrorHandling(args?: string[]): Promise<void>;

@@ -95,0 +103,0 @@ /** @internal */

@@ -86,3 +86,3 @@ "use strict";

*
* If your caller wants to trap and handle errors, use {@link CommandLineParser.executeWithoutErrorHandling}
* If your caller wants to trap and handle errors, use {@link CommandLineParser.executeWithoutErrorHandlingAsync}
* instead.

@@ -93,3 +93,3 @@ *

*/
async execute(args) {
async executeAsync(args) {
if (this._options.enableTabCompletionAction && !this._tabCompleteActionWasAdded) {

@@ -100,3 +100,3 @@ this.addAction(new TabCompletionAction_1.TabCompleteAction(this.actions, this.parameters));

try {
await this.executeWithoutErrorHandling(args);
await this.executeWithoutErrorHandlingAsync(args);
return true;

@@ -106,3 +106,3 @@ }

if (err instanceof CommandLineParserExitError_1.CommandLineParserExitError) {
// executeWithoutErrorHandling() handles the successful cases,
// executeWithoutErrorHandlingAsync() handles the successful cases,
// so here we can assume err has a nonzero exit code

@@ -135,6 +135,13 @@ if (err.message) {

/**
* This is similar to {@link CommandLineParser.execute}, except that execution errors
* @deprecated Use {@link CommandLineParser.executeAsync} instead.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
async execute(args) {
return await this.executeAsync(args);
}
/**
* This is similar to {@link CommandLineParser.executeAsync}, except that execution errors
* simply cause the promise to reject. It is the caller's responsibility to trap
*/
async executeWithoutErrorHandling(args) {
async executeWithoutErrorHandlingAsync(args) {
var _a, _b;

@@ -146,3 +153,3 @@ try {

// a real world need for it.
throw new Error('execute() was already called for this parser instance');
throw new Error('executeAsync() was already called for this parser instance');
}

@@ -227,2 +234,9 @@ this._executed = true;

}
/**
* @deprecated Use {@link CommandLineParser.executeWithoutErrorHandlingAsync} instead.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
async executeWithoutErrorHandling(args) {
await this.executeWithoutErrorHandlingAsync(args);
}
/** @internal */

@@ -261,3 +275,3 @@ _registerDefinedParameters(state) {

if (this.selectedAction) {
await this.selectedAction._execute();
await this.selectedAction._executeAsync();
}

@@ -264,0 +278,0 @@ }

@@ -52,6 +52,6 @@ import { SCOPING_PARAMETER_GROUP } from '../Constants';

/**
* {@inheritdoc CommandLineAction._execute}
* {@inheritdoc CommandLineAction._executeAsync}
* @internal
*/
_execute(): Promise<void>;
_executeAsync(): Promise<void>;
/** @internal */

@@ -58,0 +58,0 @@ _registerDefinedParameters(state: IRegisterDefinedParametersState): void;

@@ -114,6 +114,6 @@ "use strict";

/**
* {@inheritdoc CommandLineAction._execute}
* {@inheritdoc CommandLineAction._executeAsync}
* @internal
*/
async _execute() {
async _executeAsync() {
// override

@@ -143,7 +143,7 @@ if (!this._unscopedParserOptions || !this._scopedCommandLineParser) {

// Call the scoped parser using only the scoped args to handle parsing
await this._scopedCommandLineParser.executeWithoutErrorHandling(scopedArgs);
await this._scopedCommandLineParser.executeWithoutErrorHandlingAsync(scopedArgs);
// Only call execute if the parser reached the execute stage. This may not be true if
// the parser exited early due to a specified '--help' parameter.
if (this._scopedCommandLineParser.canExecute) {
await super._execute();
await super._executeAsync();
}

@@ -150,0 +150,0 @@ return;

@@ -10,6 +10,6 @@ import { type CommandLineParameterBase } from '../parameters/BaseClasses';

protected onExecute(): Promise<void>;
getCompletions(commandLine: string, caretPosition?: number): AsyncIterable<string>;
getCompletionsAsync(commandLine: string, caretPosition?: number): AsyncIterable<string>;
private _getAllActions;
tokenizeCommandLine(commandLine: string): string[];
private _getParameterValueCompletions;
private _getParameterValueCompletionsAsync;
private _getGlobalParameterOffset;

@@ -16,0 +16,0 @@ private _completeParameterValues;

@@ -83,3 +83,3 @@ "use strict";

try {
for (var _d = true, _e = __asyncValues(this.getCompletions(commandLine, caretPosition)), _f; _f = await _e.next(), _a = _f.done, !_a; _d = true) {
for (var _d = true, _e = __asyncValues(this.getCompletionsAsync(commandLine, caretPosition)), _f; _f = await _e.next(), _a = _f.done, !_a; _d = true) {
_c = _f.value;

@@ -100,4 +100,4 @@ _d = false;

}
getCompletions(commandLine, caretPosition = commandLine.length) {
return __asyncGenerator(this, arguments, function* getCompletions_1() {
getCompletionsAsync(commandLine, caretPosition = commandLine.length) {
return __asyncGenerator(this, arguments, function* getCompletionsAsync_1() {
const actions = this._actions;

@@ -134,3 +134,3 @@ if (!commandLine || !caretPosition) {

if (parameterName === secondLastToken) {
const values = yield __await(this._getParameterValueCompletions(parameterNameMap.get(parameterName)));
const values = yield __await(this._getParameterValueCompletionsAsync(parameterNameMap.get(parameterName)));
if (values.length > 0) {

@@ -147,3 +147,3 @@ yield __await(yield* __asyncDelegator(__asyncValues(this._completeParameterValues(values, lastToken))));

if (parameterName === lastToken) {
const values = yield __await(this._getParameterValueCompletions(parameterNameMap.get(parameterName)));
const values = yield __await(this._getParameterValueCompletionsAsync(parameterNameMap.get(parameterName)));
if (values.length > 0) {

@@ -177,3 +177,3 @@ yield __await(yield* __asyncDelegator(__asyncValues(values)));

}
async _getParameterValueCompletions(parameter) {
async _getParameterValueCompletionsAsync(parameter) {
let choiceParameterValues = [];

@@ -180,0 +180,0 @@ if (parameter.kind === BaseClasses_1.CommandLineParameterKind.Choice) {

{
"name": "@rushstack/ts-command-line",
"version": "4.19.5",
"version": "4.20.0",
"description": "An object-oriented command-line parser for TypeScript",

@@ -17,3 +17,3 @@ "repository": {

"string-argv": "~0.3.1",
"@rushstack/terminal": "0.10.3"
"@rushstack/terminal": "0.10.4"
},

@@ -20,0 +20,0 @@ "devDependencies": {

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

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

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

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