ethereum-optimism / superchain-registry

An index of chains which serves as the source of truth for who’s in the Superchain Ecosystem
MIT License
85 stars 99 forks source link

refactor(add-chain): refactor default command #717

Open edobry opened 3 days ago

edobry commented 3 days ago

Description

This PR refactors the add-chain tool to improve DevX in two ways:

This is achieved by extracting the default action (what happens when the tool is run without a subcommand) into a command in the cmd directory, and adding logic to the app entrypoint to call it if no subcommand is provided. This then allows us to set flags at the subcommand level, which means flags set as required will no longer cause subcommands not needing them to fail if they're not provided. In addition, this simplifies some command's logic by making it unnecessary to manually check if required flags are provided.

Metadata