Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ blake3 = { version = "1.5.0", features = ["rayon", "mmap"] }
camino = "1.0.4"
chrono = "0.4.38"
clap = { version = "4.0.0", features = ["derive", "env", "wrap_help"] }
clap_complete = { version = "4.6.0", features = ["unstable-dynamic"] }
clap_mangen = "0.2.20"
derive-where = "1.2.7"
dirs = "6.0.0"
Expand Down Expand Up @@ -58,7 +59,6 @@ nix = { version = "0.31.0", features = ["signal", "user", "fs"] }
ctrlc = { version = "3.1.1", features = ["termination"] }

[dev-dependencies]
clap_complete = "=4.5.48"
pretty_assertions = "1.0.0"
temptree = "0.2.0"
which = "8.0.0"
Expand Down
73 changes: 46 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4454,47 +4454,66 @@ described in the next section. Add the following line to your `.bashrc` to use
the same completion function as `just` for your aliased command:

```console
complete -F _just -o bashdefault -o default j
complete -F _clap_complete_just -o bashdefault -o default j
```

### Shell Completion Scripts

Shell completion scripts for Bash, Elvish, Fish, Nushell, PowerShell, and Zsh
are available [release archives](https://github.com/casey/just/releases).
Completion scripts are generated by the `just` binary itself and should be
generated and sourced on shell startup.

The `just` binary can also generate the same completion scripts at runtime
using `just --completions SHELL`:
#### Bash

```console
$ just --completions zsh > just.zsh
In `~/.bashrc`:

```bash
source <(just --completions bash)
```

Please refer to your shell's documentation for how to install them.
#### The Z Shell

*macOS Note:* Recent versions of macOS use zsh as the default shell. If you use
Homebrew to install `just`, it will automatically install the most recent copy
of the zsh completion script in the Homebrew zsh directory, which the built-in
version of zsh doesn't know about by default. It's best to use this copy of the
script if possible, since it will be updated whenever you update `just` via
Homebrew. Also, many other Homebrew packages use the same location for
completion scripts, and the built-in zsh doesn't know about those either. To
take advantage of `just` completion in zsh in this scenario, you can set
`fpath` to the Homebrew location before calling `compinit`. Note also that Oh
My Zsh runs `compinit` by default. So your `.zshrc` file could look like this:
In `~/.zshrc`:

```zsh
# Init Homebrew, which adds environment variables
eval "$(brew shellenv)"
source <(just --completions zsh)
```

#### Fish

In `~/.config/fish/config.fish`:

```fish
just --completions fish | source
```

#### Elvish

In `~/.elvish/rc.elv`:

fpath=($HOMEBREW_PREFIX/share/zsh/site-functions $fpath)
```elvish
eval (just --completions elvish | slurp)
```

#### PowerShell

In `$PROFILE`:

```powershell
just --completions powershell | Out-String | Invoke-Expression
```

#### Nushell

Write the completion script to disk:

```nu
just --completions nushell | save -f ~/.config/nushell/just.nu
```

# Then choose one of these options:
# 1. If you're using Oh My Zsh, you can initialize it here
# source $ZSH/oh-my-zsh.sh
In `config.nu`:

# 2. Otherwise, run compinit yourself
# autoload -U compinit
# compinit
```nu
use just.nu *
```

### Man Page
Expand Down
1 change: 0 additions & 1 deletion bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ cp -r \
GRAMMAR.md \
LICENSE \
README.md \
completions \
man/just.1 \
$DIST

Expand Down
193 changes: 0 additions & 193 deletions completions/just.bash

This file was deleted.

Loading
Loading