@@ -154,7 +154,7 @@ pub(crate) static DOC_HELP: &str = r"DISCUSSION:
154
154
By default, it opens the documentation index. Use the various
155
155
flags to open specific pieces of documentation." ;
156
156
157
- pub ( crate ) static COMPLETIONS_HELP : & str = r"DISCUSSION:
157
+ pub ( crate ) static COMPLETIONS_HELP : & str = r# "DISCUSSION:
158
158
Enable tab completion for Bash, Fish, Zsh, or PowerShell
159
159
The script is output on `stdout`, allowing one to re-direct the
160
160
output to the file of their choosing. Where you place the file
@@ -243,21 +243,25 @@ pub(crate) static COMPLETIONS_HELP: &str = r"DISCUSSION:
243
243
244
244
First, check if a profile has already been set
245
245
246
- PS C:\> Test-Path $profile
246
+ PS C:\> Test-Path $PROFILE
247
247
248
248
If the above command returns `False` run the following
249
249
250
- PS C:\> New-Item -path $profile -type file -force
250
+ PS C:\> New-Item -path $PROFILE -type file -force
251
251
252
- Now open the file provided by `$profile` (if you used the
253
- `New-Item` command it will be
254
- `${env:USERPROFILE}\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1`
252
+ Next, we save the completions file into a separate file and source it
253
+ inside our profile. To do so, simply use
255
254
256
- Next, we either save the completions file into our profile, or
257
- into a separate file and source it inside our profile. To save the
258
- completions into our profile simply use
255
+ PS C:\> rustup completions powershell > "$(Split-Path $PROFILE)\rustup_completions.ps1"
256
+ PS C:\> Write-Output ". `"`$PSScriptRoot\rustup_completions.ps1`"" >> $PROFILE
259
257
260
- PS C:\> rustup completions powershell >> ${env:USERPROFILE}\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
258
+ This will enable completions for the current PowerShell host. To enable
259
+ them for all hosts, replace $PROFILE by $PROFILE.CurrentUserAllHosts in the
260
+ above commands.
261
+
262
+ If you use both the Windows PowerShell powershell.exe and PowerShell Core
263
+ pwsh.exe, you may have to repeat the steps above in both, as they use
264
+ different profile directories.
261
265
262
266
CARGO:
263
267
@@ -272,7 +276,7 @@ pub(crate) static COMPLETIONS_HELP: &str = r"DISCUSSION:
272
276
273
277
ZSH:
274
278
275
- $ rustup completions zsh cargo > ~/.zfunc/_cargo" ;
279
+ $ rustup completions zsh cargo > ~/.zfunc/_cargo"# ;
276
280
277
281
pub ( crate ) static TOOLCHAIN_ARG_HELP : & str = "Toolchain name, such as 'stable', 'nightly', \
278
282
or '1.8.0'. For more information see `rustup \
0 commit comments