Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): --help subcommands display order #3459

Merged
merged 2 commits into from Oct 6, 2022

Conversation

shekhirin
Copy link
Contributor

@shekhirin shekhirin commented Oct 5, 2022

Motivation

clap-rs/clap#2808

Since clap 4.0 DeriveDisplayOrder became the default, so our subcommands ordering for cast, forge and anvil switched from lexicographic to WYSIWYG.

Solution

Return lexicographic ordering back.


forge --help

Before:

~ forge --help
Build, test, fuzz, debug and deploy Solidity contracts.

Usage: forge <COMMAND>

Commands:
  test               Run the project's tests. [aliases: t]
  script             Run a smart contract as a script, building transactions that can be sent onchain.
  coverage           Generate coverage reports.
  bind               Generate Rust bindings for smart contracts.
  build              Build the project's smart contracts. [aliases: b]
  debug              Debugs a single smart contract as a script. [aliases: d]
  update             Update one or multiple dependencies. [aliases: u]
  install            Install one or multiple dependencies. [aliases: i]
  remove             Remove one or multiple dependencies. [aliases: rm]
  remappings         Get the automatically inferred remappings for the project. [aliases: re]
  verify-contract    Verify smart contracts on Etherscan. [aliases: v]
  verify-check       Check verification status on Etherscan. [aliases: vc]
  create             Deploy a smart contract. [aliases: c]
  init               Create a new Forge project.
  completions        Generate shell completions script. [aliases: com]
  generate-fig-spec  Generate Fig autocompletion spec. [aliases: fig]
  clean              Remove the build artifacts and cache directories. [aliases: cl]
  cache              Manage the Foundry cache.
  snapshot           Create a snapshot of each test's gas usage. [aliases: s]
  config             Display the current config. [aliases: co]
  flatten            Flatten a source file and all of its imports into one file. [aliases: f]
  fmt                Formats Solidity source files.
  inspect            Get specialized information about a smart contract. [aliases: in]
  upload-selectors   Uploads abi of given contract to https://sig.eth.samczsun.com function selector database. [aliases: up]
  tree               Display a tree visualization of the project's dependency graph. [aliases: tr]
  geiger             Detects usage of unsafe cheat codes in a foundry project and its dependencies.
  help               Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help information
  -V, --version  Print version information

Find more information in the book: http://book.getfoundry.sh/reference/forge/forge.html

After:

~ forge --help
Build, test, fuzz, debug and deploy Solidity contracts.

Usage: forge <COMMAND>

Commands:
  bind               Generate Rust bindings for smart contracts.
  build              Build the project's smart contracts. [aliases: b]
  cache              Manage the Foundry cache.
  clean              Remove the build artifacts and cache directories. [aliases: cl]
  completions        Generate shell completions script. [aliases: com]
  config             Display the current config. [aliases: co]
  coverage           Generate coverage reports.
  create             Deploy a smart contract. [aliases: c]
  debug              Debugs a single smart contract as a script. [aliases: d]
  flatten            Flatten a source file and all of its imports into one file. [aliases: f]
  fmt                Formats Solidity source files.
  geiger             Detects usage of unsafe cheat codes in a foundry project and its dependencies.
  generate-fig-spec  Generate Fig autocompletion spec. [aliases: fig]
  help               Print this message or the help of the given subcommand(s)
  init               Create a new Forge project.
  inspect            Get specialized information about a smart contract. [aliases: in]
  install            Install one or multiple dependencies. [aliases: i]
  remappings         Get the automatically inferred remappings for the project. [aliases: re]
  remove             Remove one or multiple dependencies. [aliases: rm]
  script             Run a smart contract as a script, building transactions that can be sent onchain.
  snapshot           Create a snapshot of each test's gas usage. [aliases: s]
  test               Run the project's tests. [aliases: t]
  tree               Display a tree visualization of the project's dependency graph. [aliases: tr]
  update             Update one or multiple dependencies. [aliases: u]
  upload-selectors   Uploads abi of given contract to https://sig.eth.samczsun.com function selector database. [aliases: up]
  verify-check       Check verification status on Etherscan. [aliases: vc]
  verify-contract    Verify smart contracts on Etherscan. [aliases: v]

Options:
  -h, --help     Print help information
  -V, --version  Print version information

Find more information in the book: http://book.getfoundry.sh/reference/forge/forge.html

cast --help

Same ordering changes.

anvil --help

Same ordering changes.

@shekhirin shekhirin marked this pull request as ready for review October 6, 2022 10:35
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm.

failing test unrelated. rinkeby shut down.

@mattsse mattsse merged commit 74941e8 into foundry-rs:master Oct 6, 2022
iFrostizz pushed a commit to iFrostizz/foundry that referenced this pull request Nov 9, 2022
* fix(cli): --help subcommands display order

* fix anvil
larry0x added a commit to cwsoftware123/cwd that referenced this pull request Jan 27, 2024
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.

None yet

2 participants