Skip to content

Commit bb0b2f1

Browse files
authored
Merge pull request #6181 from jgreitemann/jg/kqvvzuzuzywv
docs(complete): Fix instructions for sourcing PowerShell completions
2 parents cb49eba + e495ab1 commit bb0b2f1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

clap_complete/src/env/mod.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,32 @@
3535
//!
3636
//! </div>
3737
//!
38-
//! Bash
38+
//! **Bash**
3939
//! ```bash
4040
//! echo "source <(COMPLETE=bash your_program)" >> ~/.bashrc
4141
//! ```
4242
//!
43-
//! Elvish
43+
//! **Elvish**
4444
//! ```elvish
4545
//! echo "eval (E:COMPLETE=elvish your_program | slurp)" >> ~/.elvish/rc.elv
4646
//! ```
4747
//!
48-
//! Fish
48+
//! **Fish**
4949
//! ```fish
5050
//! echo "COMPLETE=fish your_program | source" >> ~/.config/fish/config.fish
5151
//! ```
5252
//!
53-
//! Powershell
53+
//! **Powershell**
5454
//! ```powershell
55-
//! $env:COMPLETE = "powershell"
56-
//! echo "your_program | Out-String | Invoke-Expression" >> $PROFILE
57-
//! Remove-Item Env:\COMPLETE
55+
//! echo '$env:COMPLETE = "powershell"; your_program | Out-String | Invoke-Expression; Remove-Item Env:\COMPLETE' >> $PROFILE
5856
//! ```
57+
//! Note that to execute scripts in PowerShell on Windows, including [`$PROFILE`][$Profile],
58+
//! the [execution policy][ExecutionPolicies] needs to be set to `RemoteSigned` at minimum.
5959
//!
60-
//! Zsh
60+
//! [$Profile]: https://learn.microsoft.com/en-us/powershell/scripting/learn/shell/creating-profiles
61+
//! [ExecutionPolicies]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies
62+
//!
63+
//! **Zsh**
6164
//! ```zsh
6265
//! echo "source <(COMPLETE=zsh your_program)" >> ~/.zshrc
6366
//! ```

0 commit comments

Comments
 (0)