Skip to content

Commit 8c0e42f

Browse files
Tais Hjortshøjkartben
authored andcommitted
scripts: west_commands: Add powershell autocompletion (west -b)
Windows powershell can by default not autocomplete known boards when tapping which can cause frustration when you can't quite remember the exact name or you don't want to type it out. west build .\path\to\application\ -p -b stm<tab> will search for available board including 'stm' in their name. Signed-off-by: Tais Hjortshøj <[email protected]>
1 parent b5b332e commit 8c0e42f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

doc/develop/west/install.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ West currently supports shell completion in the following shells:
5353
* bash
5454
* zsh
5555
* fish
56+
* powershell (board qualifiers only)
5657

5758
In order to enable shell completion, you will need to obtain the corresponding
5859
completion script and have it sourced.
@@ -102,5 +103,22 @@ Using the completion scripts:
102103
103104
west completion fish > $HOME/.config/fish/completions/west.fish
104105
106+
.. group-tab:: powershell
107+
108+
*One-time setup*:
109+
110+
.. code-block:: powershell
111+
112+
west completion powershell | Out-String | Invoke-Expression
113+
114+
*Permanent setup*:
115+
116+
.. code-block:: powershell
117+
118+
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
119+
New-item -type file -force $PROFILE
120+
west completion powershell > $HOME/west-completion.ps1
121+
(Add-Content -Path $PROFILE -Value ". '{$HOME/west-completion.ps1}'")
122+
105123
.. _PyPI:
106124
https://pypi.org/project/west/

doc/develop/west/zephyr-cmds.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ It currently supports the following shells:
4040
- bash
4141
- zsh
4242
- fish
43+
- powershell (board qualifiers only)
4344

4445
Additional instructions are available in the command's help::
4546

0 commit comments

Comments
 (0)