File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ _x_completions ()
4+ {
5+ if [ " ${# COMP_WORDS[@]} " -le " 2" ]; then
6+ COMPREPLY=($( compgen -W " build check clippy fix fmt test bench doc clean dist install run setup" " ${COMP_WORDS[1]} " ) )
7+ return
8+ else
9+ compopt -o nospace
10+ local cur=${COMP_WORDS[COMP_CWORD]}
11+ local top=$( git rev-parse --show-toplevel 2> /dev/null || return)
12+ COMPREPLY=$( cd $top && compgen -f -- " $cur " )
13+ fi
14+ }
15+ complete -F _x_completions x
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env zsh
2+
3+ _x_completions ()
4+ {
5+ local line
6+ local top=$( git rev-parse --show-toplevel 2> /dev/null || return)
7+ cd " ${top} "
8+ _arguments -C \
9+ " 1:subcommand:(build check clippy fix fmt test bench doc clean dist install run setup)" \
10+ " *:files:_files"
11+ cd " ${OLDPWD} "
12+ }
13+ compdef _x_completions x
You can’t perform that action at this time.
0 commit comments