@lodestar/flare
Version:
Beacon chain debugging tool
26 lines (19 loc) • 618 B
text/typescript
import {getCli, yarg} from "./cli.js";
import {YargsError} from "./util/errors.js";
import "source-map-support/register.js";
const flare = getCli();
void flare
.fail((msg, err) => {
if (msg?.includes("Not enough non-option arguments")) {
// Show command help message when no command is provided
yarg.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);
})
// Execute CLI
.parse();