MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / cliMain

Function cliMain

scripts/profiler/main.ts:610–636  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

608}
609
610async function cliMain(): Promise<void> {
611 let profileArgs: ProfileArgs | undefined;
612
613 try {
614 profileArgs = resolveAndValidateArgs(process.argv.slice(2));
615 } catch (error) {
616 logError(error instanceof Error ? error.message : String(error));
617 process.exitCode = 1;
618 return;
619 }
620
621 if (profileArgs === undefined) {
622 console.log(USAGE);
623 return;
624 }
625
626 try {
627 await runProfile(profileArgs);
628 } catch (error) {
629 if (!(error instanceof Error)) {
630 throw error;
631 }
632
633 logError(error.message);
634 process.exitCode = 1;
635 }
636}
637
638if (import.meta.main) {
639 await cliMain();

Callers 1

main.tsFile · 0.70

Calls 3

logErrorFunction · 0.90
runProfileFunction · 0.85
resolveAndValidateArgsFunction · 0.70

Tested by

no test coverage detected