@oclif/core 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { CLIError } from '../errors';
2
2
  import { OptionFlag, Flag } from '../interfaces';
3
- import { Arg, ArgInput, BooleanFlag, CLIParseErrorOptions } from '../interfaces/parser';
3
+ import { Arg, ArgInput, CLIParseErrorOptions } from '../interfaces/parser';
4
4
  export { CLIError } from '../errors';
5
5
  export type Validation = {
6
6
  name: string;
@@ -47,9 +47,6 @@ export declare class NonExistentFlagsError extends CLIParseError {
47
47
  export declare class FlagInvalidOptionError extends CLIParseError {
48
48
  constructor(flag: OptionFlag<any>, input: string);
49
49
  }
50
- export declare class FailedFlagParseError extends CLIParseError {
51
- constructor(flag: BooleanFlag<any> | OptionFlag<any>, errMsg: string);
52
- }
53
50
  export declare class ArgInvalidOptionError extends CLIParseError {
54
51
  constructor(arg: Arg<any>, input: string);
55
52
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FailedFlagValidationError = exports.ArgInvalidOptionError = exports.FailedFlagParseError = exports.FlagInvalidOptionError = exports.NonExistentFlagsError = exports.UnexpectedArgsError = exports.RequiredFlagError = exports.RequiredArgsError = exports.InvalidArgsSpecError = exports.CLIParseError = exports.CLIError = void 0;
3
+ exports.FailedFlagValidationError = exports.ArgInvalidOptionError = exports.FlagInvalidOptionError = exports.NonExistentFlagsError = exports.UnexpectedArgsError = exports.RequiredFlagError = exports.RequiredArgsError = exports.InvalidArgsSpecError = exports.CLIParseError = exports.CLIError = void 0;
4
4
  const errors_1 = require("../errors");
5
5
  const help_1 = require("./help");
6
6
  const list_1 = require("../cli-ux/list");
@@ -74,13 +74,6 @@ class FlagInvalidOptionError extends CLIParseError {
74
74
  }
75
75
  }
76
76
  exports.FlagInvalidOptionError = FlagInvalidOptionError;
77
- class FailedFlagParseError extends CLIParseError {
78
- constructor(flag, errMsg) {
79
- const message = `Parsing --${flag.name} \n\t${errMsg}`;
80
- super({ parse: {}, message });
81
- }
82
- }
83
- exports.FailedFlagParseError = FailedFlagParseError;
84
77
  class ArgInvalidOptionError extends CLIParseError {
85
78
  constructor(arg, input) {
86
79
  const message = `Expected ${input} to be one of: ${arg.options.join(', ')}`;
@@ -242,7 +242,8 @@ class Parser {
242
242
  return flag.parse ? await flag.parse(input, this.context, flag) : input;
243
243
  }
244
244
  catch (error) {
245
- throw new errors_1.FailedFlagParseError(flag, error.message);
245
+ error.message = `Parsing --${flag.name} \n\t${error.message}\nSee more help with --help`;
246
+ throw error;
246
247
  }
247
248
  }
248
249
  _validateOptions(flag, input) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "2.0.4",
4
+ "version": "2.0.5",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {