Err when providing non-installed package name to `suggest`
Is your feature request related to a problem? Please describe.
The composer suggest command allows providing a package name to use as filter, e.g. composer suggest composer/composer will only show suggestions by the composer package. However, when one provides an expression of a non-installed package, the output of the command will be empty, which is not distinguishable from a response that the package does not have (fulfilled) suggests.
For example:
composer suggest composer/composerwill often result in no output, given you are running- if ran on a repository not having
composer/composerin its dependency tree
- if ran on a repository not having
composer suggest composer/composrwill always result in no output, not notifying the user of their typocomposer suggest composer/*will always result in no output, not notifying the user of the fact that this syntax is not supported for this commandcomposer suggest allwill always result in no output, not notifying the user of the fact they probably intended to usecomposer suggest --all
Describe the solution you'd like
Whenever the package provided as filter is not found in the installed packages, err and exit with code non-zero:
> composer suggest composer/composr
composer/composr is not installedDescribe alternatives you've considered Alternatively, the output could be altered to "always" display results of some kind, e.g.
> composer suggest composer/composer
no suggestions found for composer/composerThis would improve for some of the cases above, but probably less so than an explicit error.
Additional context
Source: composer/composer