File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 66 type OptionValueSource ,
77 type OptionValues ,
88 Option ,
9+ CommanderError ,
910} from "commander" ;
1011import { partialParse } from "parse-my-command" ;
1112
@@ -109,7 +110,17 @@ export class InteractiveCommand extends Command {
109110 this . _providedOptions = providedOptions ;
110111 this . _missingOptions = missingOptions ;
111112 this . _providedOptionsSources = providedOptionsSources ;
112- } catch { }
113+ } catch ( error ) {
114+ if ( ! ( error instanceof CommanderError ) ) {
115+ // eslint-disable-next-line @typescript-eslint/no-throw-literal
116+ throw error ;
117+ }
118+
119+ // Is this enough?
120+ if ( ! [ "commander.helpDisplayed" ] . includes ( error . code ) ) {
121+ super . error ( error . message , error ) ;
122+ }
123+ }
113124
114125 // Even if we prompt for the missing options of the root command here, there
115126 // is no easy way to feed them into super.parseAsync. Therefore, interactive
You can’t perform that action at this time.
0 commit comments