Commit 66da382
committed
Better error messages for unsupported
Instead of parsing whatever string the user supplied as the tool name
and supplying a default `VersionSpec`, attempt to parse the value as a
full specifier which may include a version. This means we can provide
better errors when the user passes a version. Specifically we can report
that Volta does not yet support uninstalling specific versions of tools.
Previously, we would report something like this:
```
warning: No package '[email protected]' found to uninstall
```
Notice that the old message treated `'[email protected]'` as the name of
the tool, when it should have been treating it as a tool and a version
specifier. Now, we instead report that uninstalling specific versions of
tools is unsupported.
The original motivation here was noticing that we printed errors like
that if the user tried to uninstall a runtime or a package manager with
a version specifier. This fixes that as well, since it no longer parses
a string like `[email protected]` as a package, but rather as a runtime and
version specifier, and can fall into the normal handling for runtimes.uninstall arguments1 parent fd8cc68 commit 66da382
File tree
2 files changed
+28
-11
lines changed- src/command
- tests/acceptance
2 files changed
+28
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
20 | 32 | | |
21 | 33 | | |
22 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 121 | | |
128 | 122 | | |
129 | 123 | | |
| |||
210 | 204 | | |
211 | 205 | | |
212 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
0 commit comments