|
198 | 198 |
|
199 | 199 | ## Command-line completion |
200 | 200 |
|
201 | | -To set up command-line completion, source the output of |
202 | | -`jj util completion bash/zsh/fish`. Exactly how to source it |
203 | | -depends on your shell. |
204 | | - |
205 | | -Improved completions are also available. They will complete things like |
206 | | -bookmarks, aliases, revisions, operations and files. They can be context aware, |
207 | | -for example they respect the global flags `--repository` and `--at-operation` as |
208 | | -well as some command-specific ones like `--revision`, `--from` and `--to`. You |
209 | | -can activate them with the alternative "dynamic" instructions below. They should |
210 | | -still complete everything the static completions did, so only activate one of |
211 | | -them. Please let us know if you encounter any issues, so we can ensure a smooth |
212 | | -transition once we default to these new completions. |
213 | | - |
214 | | -!!! info "Why are the improved completions not the default?" |
215 | | - |
216 | | - To generate the dynamic completion script, execute `jj` with `$COMPLETE` set |
217 | | - to the name of your shell (see examples below). See the upstream clap issue |
218 | | - [#3166][clap] for the explanation. |
| 201 | +Jujutsu provides 2 different command-line completion scripts. |
| 202 | + |
| 203 | +### Standard completions |
| 204 | + |
| 205 | +The standard completion script provides completions for `jj` subcommmands and |
| 206 | +options. |
| 207 | + |
| 208 | +### Dynamic completions |
| 209 | + |
| 210 | +The dynamic completion script provides completions for `jj` subcommands and |
| 211 | +options, as well as additional completions, including bookmarks, |
| 212 | +aliases, revisions, operations and files. Dynamic completions can be context |
| 213 | +aware, for example they respect the global flags `--repository` and |
| 214 | +`--at-operation` as well as some command-specific ones like `--revision`, |
| 215 | +`--from`, and `--to`. |
| 216 | + |
| 217 | +Dynamic completions are not the default/only option since the underlying engine |
| 218 | +[is still labelled unstable][clap]. We expect to transition to them as the |
| 219 | +default once the engine is stabilized. Please let us know if you encounter any |
| 220 | +issues with dynamic completions. |
| 221 | + |
| 222 | +!!! info "Which completion script should I use?" |
| 223 | + |
| 224 | + Generally, dynamic completions provide a much better completion experience. |
| 225 | + Although the underlying engine is deemed unstable, there have not been many |
| 226 | + issues in practice. Dynamic completions are the preferred option for many |
| 227 | + contributors and users. |
| 228 | + |
| 229 | + We recommend using the dynamic completion script, and falling back to the |
| 230 | + standard completion script if there are any issues. |
219 | 231 |
|
220 | 232 | <!-- The content tabs formatting below is optimized for the website and not for GitHub. --> |
221 | 233 |
|
|
0 commit comments