Add command and package suggestions#40895
Merged
tgamblin merged 3 commits intospack:developfrom Nov 5, 2023
Merged
Conversation
Member
|
Can we get this for package names too? |
This adds suggestions of similar commands in case users mistype a command. Before: ``` $ spack spack ==> Error: spack is not a recognized Spack command or extension command; check with `spack commands`. ``` After: ``` $ spack spack ==> Error: spack is not a recognized Spack command or extension command; check with `spack commands`. Did you mean one of the following commands? spec patch ```
8f742f6 to
7a53e1d
Compare
Member
Author
|
I've pushed a new commit that should do it: |
Member
|
This may be the single greatest addition to Spack in the history of Spack. |
adamjstewart
reviewed
Nov 5, 2023
lib/spack/spack/repo.py
Outdated
Comment on lines
+1520
to
+1521
| long_msg = "You may need to run 'spack clean -m'" | ||
| long_msg += " or use 'spack create' to create a new package." |
Member
There was a problem hiding this comment.
Can we remove this? At one time it was very common for issues with cached packages that were renamed. Nowadays this is less common and most of the time it was simply a typo.
Member
Author
There was a problem hiding this comment.
Done, I've kept the spack create suggestion for now, should we also remove that?
Member
There was a problem hiding this comment.
I'm fine with keeping it. spack clean just felt like we were documenting a bug.
9bf9005 to
e58e9cf
Compare
tgamblin
approved these changes
Nov 5, 2023
Member
tgamblin
left a comment
There was a problem hiding this comment.
Ok this is awesome! Thanks @michaelkuhn!
gabrielctn
pushed a commit
to gabrielctn/spack
that referenced
this pull request
Nov 24, 2023
* Add command suggestions This adds suggestions of similar commands in case users mistype a command. Before: ``` $ spack spack ==> Error: spack is not a recognized Spack command or extension command; check with `spack commands`. ``` After: ``` $ spack spack ==> Error: spack is not a recognized Spack command or extension command; check with `spack commands`. Did you mean one of the following commands? spec patch ``` * Add package name suggestions * Remove suggestion to run spack clean -m
This was referenced Nov 29, 2023
mtaillefumier
pushed a commit
to mtaillefumier/spack
that referenced
this pull request
Dec 14, 2023
* Add command suggestions This adds suggestions of similar commands in case users mistype a command. Before: ``` $ spack spack ==> Error: spack is not a recognized Spack command or extension command; check with `spack commands`. ``` After: ``` $ spack spack ==> Error: spack is not a recognized Spack command or extension command; check with `spack commands`. Did you mean one of the following commands? spec patch ``` * Add package name suggestions * Remove suggestion to run spack clean -m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds suggestions of similar commands in case users mistype a command. Before:
After: