wasi-master / pypi-command-line

A powerful, colorful, beautiful command-line-interface for pypi.org
https://wasi-master.github.io/pypi-command-line/
MIT License
46 stars 7 forks source link

[BUG] ... #26

Open wasi-master opened 1 year ago

wasi-master commented 1 year ago

Describe the bug

If a package isn't installed the version command errors out instead of notifying the user

To Reproduce

Use the version command with the --show-installed-version flag on a package that you have not yet installed

Expected behavior

It should show an error message to the user

Additional context

To fix, in the line https://github.com/wasi-master/pypi-command-line/blob/6e0bf75e9bc6d1f5e2fc78d321a2f5b9ecbf679e/pypi_cli/__main__.py#L1417 remove pass and set version_info to None then add a check for if the version_info is none or it has a value and if it is none then show an error message, simple https://github.com/wasi-master/pypi-command-line/blob/6e0bf75e9bc6d1f5e2fc78d321a2f5b9ecbf679e/pypi_cli/__main__.py#L1419-L1420

or version_info could be set to "Could not find version" and then show it always