Skip to content

Conversation

@elle-j
Copy link
Contributor

@elle-j elle-j commented Jan 13, 2026

Description

Adds default values to the compiler arguments below when parsed by clap. This does not change previous user-facing behavior as these defaults were implemented using different logic, but improves the UX and the visibility of the exact defaults used.

Example output from resolc --help:
(Only affected arguments are shown here, and some of their descriptions have been omitted here.)

Options:

  -O, --optimization <OPTIMIZATION>
          Set the optimization parameter -O[0 | 1 | 2 | 3 | s | z]. Use `3` for best performance and `z` for minimal size
          
          [default: z]

      --metadata-hash <METADATA_HASH>
          Set the metadata hash type. Available types: `none`, `ipfs`, `keccak256`
          
          [default: keccak256]

      --heap-size <HEAP_SIZE>
          The emulated EVM linear heap memory static buffer size in bytes.
          ...
          
          [default: 131072]

      --stack-size <STACK_SIZE>
          The contracts total stack size in bytes.
          ...
          
          [default: 131072]

Resolved Issues

Closes #446

Comment on lines 420 to 424
fn came_from_default_value(argument_id: &str, argument_matches: &ArgMatches) -> bool {
argument_matches
.value_source(argument_id)
.is_some_and(|source| source == ValueSource::DefaultValue)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference and examples, see value_source and default_value.

Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo some nits

@xermicus
Copy link
Member

Closes #446

@elle-j elle-j marked this pull request as ready for review January 14, 2026 09:55
@elle-j elle-j merged commit f5fe3fa into main Jan 14, 2026
14 checks passed
@elle-j elle-j deleted the lj/cli-args branch January 14, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display default value in --help

3 participants