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

cac

Package Overview
Dependencies
Maintainers
3
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cac - npm Package Compare versions

Comparing version 6.5.10 to 6.5.11

1

dist/index.d.ts

@@ -173,2 +173,3 @@ /// <reference types="node" />

private setParsedInfo;
unsetMatchedCommand(): void;
/**

@@ -175,0 +176,0 @@ * Parse argv

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

}
unsetMatchedCommand() {
this.matchedCommand = void 0;
this.matchedCommandName = void 0;
}
parse(argv = processArgs, {run = true} = {}) {

@@ -511,2 +515,3 @@ this.rawArgs = argv;

run = false;
this.unsetMatchedCommand();
}

@@ -516,2 +521,3 @@ if (this.options.version && this.showVersionOnExit) {

run = false;
this.unsetMatchedCommand();
}

@@ -518,0 +524,0 @@ const parsedArgv = {

@@ -200,2 +200,3 @@

private setParsedInfo;
unsetMatchedCommand(): void;
/**

@@ -202,0 +203,0 @@ * Parse argv

@@ -898,2 +898,6 @@ // Copyright Joyent, Inc. and other Node contributors.

}
unsetMatchedCommand() {
this.matchedCommand = void 0;
this.matchedCommandName = void 0;
}
parse(argv = processArgs, {run = true} = {}) {

@@ -934,2 +938,3 @@ this.rawArgs = argv;

run = false;
this.unsetMatchedCommand();
}

@@ -939,2 +944,3 @@ if (this.options.version && this.showVersionOnExit) {

run = false;
this.unsetMatchedCommand();
}

@@ -941,0 +947,0 @@ const parsedArgv = {

2

package.json
{
"name": "cac",
"version": "6.5.10",
"version": "6.5.11",
"description": "Simple yet powerful framework for building command-line apps.",

@@ -5,0 +5,0 @@ "repository": {

@@ -32,2 +32,3 @@ <img width="945" alt="2017-07-26 9 27 05" src="https://user-images.githubusercontent.com/8784712/28623641-373450f4-7249-11e7-854d-1b076dab274d.png">

- [Supply an array as option value](#supply-an-array-as-option-value)
- [Error Handling](#error-handling)
- [With TypeScript](#with-typescript)

@@ -266,2 +267,21 @@ - [With Deno](#with-deno)

### Error Handling
To handle command errors globally:
```js
try {
// Parse CLI args without running the command
cli.parse(process.argv, { run: false })
// Run the command yourself
// You only need `await` when your command action returns a Promise
await cli.runMatchedCommand()
} catch (error) {
// Handle error here..
// e.g.
// console.error(error.stack)
// process.exit(1)
}
```
### With TypeScript

@@ -268,0 +288,0 @@

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