From bbe287561b79c7c37345f7e724dd0fdf0a5d269a Mon Sep 17 00:00:00 2001 From: Fedor Kuznetsov Date: Tue, 20 Dec 2022 19:09:01 +0500 Subject: [PATCH] Add documentation --- README.md | 5 ++++- src/cleo/commands/completions_command.py | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf323941..1cfa1b10 100644 --- a/README.md +++ b/README.md @@ -412,7 +412,7 @@ the `call_silent()` method instead. ### Autocompletion -Cleo supports automatic (tab) completion in `bash`, `zsh` and `fish`. +Cleo supports automatic (tab) completion in `bash`, `zsh`, `fish` and `PowerShell`. By default, your application will have a `completions` command. To register these completions for your application, run one of the following in a terminal (replacing `[program]` with the command you use to run your application): @@ -433,4 +433,7 @@ echo "fpath+=~/.zfunc" >> ~/.zshrc # Fish [program] completions fish > ~/.config/fish/completions/[program].fish + +# PowerShell +[program] completions PowerShell > $PROFILE ``` diff --git a/src/cleo/commands/completions_command.py b/src/cleo/commands/completions_command.py index be0f4bbe..b8f4e93d 100644 --- a/src/cleo/commands/completions_command.py +++ b/src/cleo/commands/completions_command.py @@ -14,7 +14,7 @@ class CompletionsCommand(Command): - + name = "completions" description = "Generate completion scripts for your shell." @@ -98,6 +98,13 @@ class CompletionsCommand(Command): For the new completions to take affect. +PowerShell: + +PowerShell profiles are stored at $PROFILE path, so you can simply \ +run command like this: + +`{script_name} {command_name} PowerShell > $PROFILE` + CUSTOM LOCATIONS: Alternatively, you could save these files to the place of your choosing, \