diff --git a/cli/src/commands/util.rs b/cli/src/commands/util.rs index c4d6e3426c..02c134bf8c 100644 --- a/cli/src/commands/util.rs +++ b/cli/src/commands/util.rs @@ -40,13 +40,13 @@ pub(crate) enum UtilCommand { Apply it by running one of these: -- **bash**: `source <(jj util completion)` -- **fish**: `jj util completion --fish | source` +- **bash**: `source <(jj util completion bash)` +- **fish**: `jj util completion fish | source` - **zsh**: ```shell autoload -U compinit compinit - source <(jj util completion --zsh) + source <(jj util completion zsh) ``` "#] #[derive(clap::Args, Clone, Debug)] diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 323117b30e..dfb35be4fe 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1740,13 +1740,13 @@ Print a command-line-completion script Apply it by running one of these: -- **bash**: `source <(jj util completion)` -- **fish**: `jj util completion --fish | source` +- **bash**: `source <(jj util completion bash)` +- **fish**: `jj util completion fish | source` - **zsh**: ```shell autoload -U compinit compinit - source <(jj util completion --zsh) + source <(jj util completion zsh) ``` **Usage:** `jj util completion [SHELL]` diff --git a/docs/install-and-setup.md b/docs/install-and-setup.md index 9374e911a4..057ae59660 100644 --- a/docs/install-and-setup.md +++ b/docs/install-and-setup.md @@ -156,7 +156,7 @@ $ jj config set --user user.email "martinvonz@google.com" ## Command-line completion To set up command-line completion, source the output of -`jj util completion --bash/--zsh/--fish`. Exactly how to source it +`jj util completion bash/zsh/fish`. Exactly how to source it depends on your shell. ### Bash @@ -170,13 +170,13 @@ source <(jj util completion) # --bash is the default ```shell autoload -U compinit compinit -source <(jj util completion --zsh) +source <(jj util completion zsh) ``` ### Fish ```shell -jj util completion --fish | source +jj util completion fish | source ``` ### Xonsh diff --git a/flake.nix b/flake.nix index 4f6e32c7e2..2a964ebbc4 100644 --- a/flake.nix +++ b/flake.nix @@ -99,9 +99,9 @@ installManPage ./jj.1 installShellCompletion --cmd jj \ - --bash <($out/bin/jj util completion --bash) \ - --fish <($out/bin/jj util completion --fish) \ - --zsh <($out/bin/jj util completion --zsh) + --bash <($out/bin/jj util completion bash) \ + --fish <($out/bin/jj util completion fish) \ + --zsh <($out/bin/jj util completion zsh) ''; }; default = self.packages.${system}.jujutsu;