@anycli/parser
Advanced tools
Comparing version 3.2.5 to 3.2.6
@@ -0,1 +1,9 @@ | ||
<a name="3.2.6"></a> | ||
## [3.2.6](https://github.com/anycli/parser/compare/15bb0d0e7ac8d7b933f3a6731f3988ae5786e129...v3.2.6) (2018-02-06) | ||
### Bug Fixes | ||
* use [@anycli](https://github.com/anycli)/errors ([b227608](https://github.com/anycli/parser/commit/b227608)) | ||
<a name="3.2.5"></a> | ||
@@ -2,0 +10,0 @@ ## [3.2.5](https://github.com/anycli/parser/compare/595a4faa0a0377bec9e9e630ea53db20c0eea735...v3.2.5) (2018-02-05) |
@@ -0,1 +1,2 @@ | ||
import { CLIError } from '@anycli/errors'; | ||
import { Arg } from './args'; | ||
@@ -10,3 +11,3 @@ import * as flags from './flags'; | ||
} | ||
export declare class CLIParseError extends Error { | ||
export declare class CLIParseError extends CLIError { | ||
parse: ICLIParseErrorOptions['parse']; | ||
@@ -13,0 +14,0 @@ constructor(options: ICLIParseErrorOptions & { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const errors_1 = require("@anycli/errors"); | ||
const deps_1 = require("./deps"); | ||
const help_1 = require("./help"); | ||
class CLIParseError extends Error { | ||
class CLIParseError extends errors_1.CLIError { | ||
constructor(options) { | ||
@@ -7,0 +8,0 @@ options.message += '\nSee more help with --help'; |
"use strict"; | ||
// tslint:disable interface-over-type-literal | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const errors_1 = require("@anycli/errors"); | ||
const Errors = require("./errors"); | ||
@@ -68,3 +69,3 @@ const util_1 = require("./util"); | ||
if (!input) { | ||
throw new Error(`Flag --${name} expects a value`); | ||
throw new errors_1.CLIError(`Flag --${name} expects a value`); | ||
} | ||
@@ -126,3 +127,3 @@ this.raw.push({ type: 'flag', flag: flag.name, input }); | ||
if (!flag) | ||
throw new Error(`Unexpected flag ${token.flag}`); | ||
throw new errors_1.CLIError(`Unexpected flag ${token.flag}`); | ||
if (flag.type === 'boolean') { | ||
@@ -129,0 +130,0 @@ if (token.input === `--no-${flag.name}`) { |
{ | ||
"name": "@anycli/parser", | ||
"description": "arg and flag parser for anycli", | ||
"version": "3.2.5", | ||
"version": "3.2.6", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -9,2 +9,3 @@ "bugs": "https://github.com/anycli/parser/issues", | ||
"devDependencies": { | ||
"@anycli/errors": "^0.2.0", | ||
"@anycli/tslint": "^0.2.5", | ||
@@ -11,0 +12,0 @@ "@heroku/linewrap": "^1.0.0", |
35318
783
18