From fb10e3f296beb5d273e52724fee374cdf7d88ff5 Mon Sep 17 00:00:00 2001 From: "Alexis (Poliorcetics) Bourget" Date: Fri, 16 Feb 2024 23:13:08 +0100 Subject: [PATCH] completion: Update docs for new style with positional argument --- cli/src/commands/util.rs | 6 +++--- cli/tests/cli-reference@.md.snap | 6 +++--- docs/install-and-setup.md | 6 +++--- flake.nix | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cli/src/commands/util.rs b/cli/src/commands/util.rs index c4d6e3426..02c134bf8 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 586b8c3db..8e11a0256 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 9374e911a..057ae5966 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 4f6e32c7e..2a964ebbc 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;