Skip to content

Better justfile command input validation #1236

@blmalone

Description

@blmalone

When a user incorrectly uses a command in the justfile (e.g. sign) they're not given a meaningful error message to tell them what they've done wrong. A rececnt example is:

Error:

Error: bad file '/Users/matthewslipper/dev/superchain-ops/src/addresses.toml': error retrieving table [opsep] value: %!w(<nil>)
Error (get-safe.sh): SAFE_NAME 'FoundationOperationsSafe' not found in /Users/matthewslipper/dev/superchain-ops/src/tasks/eth/022-U16a-opcm-upgrade-v410-base/config.toml

by using the command:

just --dotenv-path $(pwd)/.env sign foundation-operations 2

In reality, the command the signer should've been using is:

HD_PATH=2 just --dotenv-path $(pwd)/.env sign foundation-operations 

The interface had changed and they were using the old interface for the sign command.

I think there is a broader question of whether we want to get rid of the justfile entirely and rely on a more robust cli library. Perhaps one from the Go ecosystem like op-deployer makes use of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions