Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ZettZet committed Jan 29, 2023
1 parent 750dd0c commit bbe2875
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -433,4 +433,7 @@ echo "fpath+=~/.zfunc" >> ~/.zshrc

# Fish
[program] completions fish > ~/.config/fish/completions/[program].fish

# PowerShell
[program] completions PowerShell > $PROFILE
```
9 changes: 8 additions & 1 deletion src/cleo/commands/completions_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


class CompletionsCommand(Command):

name = "completions"
description = "Generate completion scripts for your shell."

Expand Down Expand Up @@ -98,6 +98,13 @@ class CompletionsCommand(Command):
For the new completions to take affect.
<option=bold>PowerShell</>:
PowerShell profiles are stored at $PROFILE path, so you can simply \
run command like this:
`<options=bold>{script_name} {command_name} PowerShell > $PROFILE</>`
<options=bold>CUSTOM LOCATIONS</>:
Alternatively, you could save these files to the place of your choosing, \
Expand Down

0 comments on commit bbe2875

Please sign in to comment.