Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update command line completion docs #793

Merged
merged 2 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/command-line-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ By default this command will print on the standard output (the shell window) the
Use `arduino-cli completion bash > arduino-cli.sh` to generate the completion file.
At this point you can move that file in `/etc/bash_completion.d/` (root access is required) with `sudo mv arduino-cli.sh /etc/bash_completion.d/`.

A not recommended alternative is to source the completion file in `.bashrc`.
A not recommended alternative is to source the completion file in `~/.bashrc`.

Remember to open a new shell to test the functionality
Remember to open a new shell to test the functionality.

### Zsh
Use `arduino-cli completion zsh > _arduino-cli` to generate the completion file.
Expand All @@ -23,23 +23,23 @@ At this point you can place the file in a directory listed in your `fpath` if yo
Or if you want you can create a directory, add it to your `fpath` and copy the file in it:

1. `mkdir ~/completion_zsh`
2. add `fpath=($HOME/completion_zsh $fpath)` at the beginning of your `.zshrc` file
2. add `fpath=($HOME/completion_zsh $fpath)` at the beginning of your `~/.zshrc` file
3. `mv _arduino-cli ~/completion_zsh/`

Remember to open a new shell to test the functionality

*N.B.*
The Zsh completion is working with [Oh-My-Zsh](https://ohmyz.sh/) but not with [Prezto](https://github.com/sorin-ionescu/prezto) (the zsh completion system is working in a different way than classic zsh). But hopefully it will be fixed in the future
Remember to open a new shell to test the functionality.

### Fish
Use `arduino-cli completion fish > arduino-cli.fish` to generate the completion file.
At this point you can place the file in `~/.config/fish/completions` as stated in the [official documentation](http://fishshell.com/docs/current/index.html#where-to-put-completions).
Remember to create the directory if it's not already there `mkdir -p ~/.config/fish/completions/` and then place the completion file in there with `mv arduino-cli.fish ~/.config/fish/completions/`

Remember to open a new shell to test the functionality
Remember to open a new shell to test the functionality.

#### Disabling command and flag descriptions
By default fish completion has command and flag description enabled by default. If you want to disable this behaviour you can simply pass the `--no-descriptions` flag when calling `completion` command and the generated file will not have descriptions

*N.B.*
This flag is not compatible with bash or zsh

### Brew
If you install the `arduino-cli` using [homebrew](https://brew.sh/) package manager the completion should work out of the box if you have followed the [official documentation](https://docs.brew.sh/Shell-Completion).
2 changes: 2 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The Arduino CLI is available as a Homebrew formula since version
brew update
brew install arduino-cli
```
#### Command line completion
[Command line completion](command-line-completion.md#brew) files are already bundled in the homebrew installation.

### Use the install script

Expand Down