fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian BoehmMake functions, completions and tests resilient to running on an embed-data fish329cd7d42

master
1.9 KiB27 linesraw
1# tig - text-mode interface for Git
2
3functions -q __fish_git || complete -C"git " &>/dev/null
4
5set -l subcommands log show reflog blame grep refs statsh status
6complete -c tig -n "not contains -- -- (commandline -xpc) && not __fish_seen_subcommand_from $subcommands" -xa 'show\t"Open diff view using the given git-show(1) options"
7blame\t"Annotate the given file, takes git-blame(1) options"
8status\t"Start up in status view"
9log\t"Start up in log view view, displaying git-log(1) output"
10reflog\t"Start up in reflog view"
11refs\t"Start up in refs view"
12stash\t"Start up in stash view"
13grep\t"Open the grep view. Supports the same options as git-grep(1)"
14'
15complete -c tig -n 'not contains -- -- (commandline -xpc)' -l stdin -d 'Read git commit IDs from stdin'
16complete -c tig -n 'not contains -- -- (commandline -xpc)' -l pretty=raw -d 'Read git log output from stdin'
17complete -c tig -n 'not contains -- -- (commandline -xpc)' -s C -r -d 'Run as if Tig was started in this directory'
18complete -c tig -n 'not contains -- -- (commandline -xpc)' -s v -l version -d 'Show version and exit'
19complete -c tig -n 'not contains -- -- (commandline -xpc)' -s h -l help -d 'Show help message and exit'
20
21complete -c tig -n 'not contains -- -- (commandline -xpc) && __fish_seen_subcommand_from show' -xa '(set -l t (commandline -ct); complete -C"git show $t")'
22complete -c tig -n 'not contains -- -- (commandline -xpc) && __fish_seen_subcommand_from blame' -xa '(set -l t (commandline -ct); complete -C"git blame $t")'
23complete -c tig -n 'not contains -- -- (commandline -xpc) && __fish_seen_subcommand_from log' -xa '(set -l t (commandline -ct); complete -C"git log $t")'
24complete -c tig -n 'not contains -- -- (commandline -xpc) && __fish_seen_subcommand_from grep' -xa '(set -l t (commandline -ct); complete -C"git grep $t")'
25
26complete -c tig -f -n 'not contains -- -- (commandline -xpc)' -a '(__fish_git_ranges)'
27complete -c tig -n 'contains -- -- (commandline -xpc)' -F