import yargs from "yargs" ; import { YargsError } from "./util" ; import { getLodestarCli } from "./cli" ; import "source-map-support/register" ; const lodestar = getLodestarCli ( ) ; lodestar . fail ( ( msg , err ) => { if ( msg ) { if ( msg . includes ( "Not enough non-option arguments" ) ) { yargs . showHelp ( ) ; console . log ( "\n" ) ; } } const errorMessage = err !== undefined ? ( err instanceof YargsError ? err . message : err . stack ) : msg || "Unknown error" ; console . error ( ` ✖ ${ errorMessage }\n` ) ; process . exit ( 1 ) ; } ) . parse ( ) ;