🐛 fix (default) and (installed) on rustup completions (#721)

Updating rust by
```
rustup update <tab>
```
gives you:


![image](https://github.com/nushell/nu_scripts/assets/30557287/fe65bebc-c593-46b2-b696-bc1d093ee0b6)

and when you press enter on stable:

![image](https://github.com/nushell/nu_scripts/assets/30557287/59b98da7-f174-4518-b30b-88e6a9462603)

the ` (default)` part is piped into the cmdline. This is unintended.
I fixed components, toolchains & targets 💪🏼
This commit is contained in:
Auca Coyan 2023-12-29 11:35:15 -03:00 committed by GitHub
parent 8386cdc628
commit b9cfa0d204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ def "nu-complete rustup toolchain" [] {
def "nu-complete rustup toolchain list" [] {
^rustup toolchain list
| lines
| str replace " (default)" ""
| append 'stable'
| append 'beta'
| append 'nightly'
@ -39,6 +40,7 @@ def "nu-complete rustup target" [] {
def "nu-complete rustup target list" [] {
^rustup target list
| lines
| str replace " (installed)" ""
}
def "nu-complete rustup target list --installed" [] {
@ -47,8 +49,9 @@ def "nu-complete rustup target list --installed" [] {
}
def "nu-complete rustup update" [] {
^rustup toolchain list
| lines
^rustup toolchain list
| lines
| str replace " (default)" ""
}
def "nu-complete rustup component" [] {
@ -63,6 +66,7 @@ def "nu-complete rustup component" [] {
def "nu-complete rustup component list" [] {
^rustup component list
| lines
| str replace " (installed)" ""
}
def "nu-complete rustup component list installed" [] {