crytic / solc-select

Manage and switch between Solidity compiler versions
GNU Affero General Public License v3.0
747 stars 99 forks source link

`solc-select versions` should indicate that there aren't any versions of solc installed instead of erroring #152

Open 0xalpharush opened 1 year ago

0xalpharush commented 1 year ago

If you run solc-select versions in a fresh venv, it's expected that solc isn't installed. The error message could be more helpful instead of the current behavior:

(slither) alpharush@macbook slither % solc-select versions
Traceback (most recent call last):
  File "/opt/homebrew/bin/solc-select", line 8, in <module>
    sys.exit(solc_select())
             ^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/solc-select/1.0.2/libexec/lib/python3.11/site-packages/solc_select/__main__.py", line 64, in solc_select
    res = current_version()
          ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/solc-select/1.0.2/libexec/lib/python3.11/site-packages/solc_select/solc_select.py", line 60, in current_version
    raise argparse.ArgumentTypeError(
argparse.ArgumentTypeError: No solc version set. Run `solc-select use VERSION` or set SOLC_VERSION environment variable.