From 1fa4874e9fac546770b290f58d5e84dd082b086b Mon Sep 17 00:00:00 2001 From: Umberto Baldi <34278123+umbynos@users.noreply.github.com> Date: Tue, 7 Jul 2020 14:08:00 +0200 Subject: [PATCH] Update command line completion docs (#793) * update command line completion docs * add brew command line completion sub-section in installation docs --- docs/command-line-completion.md | 16 ++++++++-------- docs/installation.md | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/command-line-completion.md b/docs/command-line-completion.md index 35455e7c90e..6535360144b 100644 --- a/docs/command-line-completion.md +++ b/docs/command-line-completion.md @@ -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. @@ -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). diff --git a/docs/installation.md b/docs/installation.md index de01e5781aa..c235f063ae5 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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