Skip to content

Commit

Permalink
Update command line completion docs (#793)
Browse files Browse the repository at this point in the history
* update command line completion docs

* add brew command line completion sub-section in installation docs
  • Loading branch information
umbynos committed Jul 7, 2020
1 parent 0b457a9 commit 1fa4874
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/command-line-completion.md
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
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

0 comments on commit 1fa4874

Please sign in to comment.