2020-03-28 05:20:12 +08:00
# tig - text-mode interface for Git
not functions -q __fish_git && source $__fish_data_dir /completions/git.fish
set -l subcommands log show reflog blame grep refs statsh status
2020-03-30 05:08:19 +08:00
complete -c tig -n " not contains -- -- (commandline -opc) && not __fish_seen_subcommand_from $subcommands " -xa 'show\t "Open diff view using the given git-show(1) options"
2020-03-28 05:20:12 +08:00
blame \t "Annotate the given file, takes git-blame(1) options"
status \t "Start up in status view"
log \t "Start up in log view view, displaying git-log(1) output"
reflog \t "Start up in reflog view"
refs \t "Start up in refs view"
stash \t "Start up in stash view"
grep \t "Open the grep view. Supports the same options as git-grep(1)"
'
2020-03-30 05:08:19 +08:00
complete -c tig -n 'not contains -- -- (commandline -opc)' -l stdin -d 'Read git commit IDs from stdin'
complete -c tig -n 'not contains -- -- (commandline -opc)' -l pretty = raw -d 'Read git log output from stdin'
complete -c tig -n 'not contains -- -- (commandline -opc)' -o C. -d 'Run as if Tig was started in .'
complete -c tig -n 'not contains -- -- (commandline -opc)' -s v -l version -d 'Show version and exit'
complete -c tig -n 'not contains -- -- (commandline -opc)' -s h -l help -d 'Show help message and exit'
2020-03-28 05:20:12 +08:00
2020-03-30 05:08:19 +08:00
complete -c tig -n 'not contains -- -- (commandline -opc) && __fish_seen_subcommand_from show' -xa '(set -l t (commandline -ct); complete -C"git show $t")'
complete -c tig -n 'not contains -- -- (commandline -opc) && __fish_seen_subcommand_from blame' -xa '(set -l t (commandline -ct); complete -C"git blame $t")'
complete -c tig -n 'not contains -- -- (commandline -opc) && __fish_seen_subcommand_from log' -xa '(set -l t (commandline -ct); complete -C"git log $t")'
complete -c tig -n 'not contains -- -- (commandline -opc) && __fish_seen_subcommand_from grep' -xa '(set -l t (commandline -ct); complete -C"git grep $t")'
2020-03-28 05:20:12 +08:00
complete -c tig -f -n 'not contains -- -- (commandline -opc)' -a '(__fish_git_ranges)'
complete -c tig -n 'contains -- -- (commandline -opc)' -F