fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
329cd7d42
master
1set -l commands autoupdate clean gc init-templatedir install install-hooks migrate-config run sample-config try-repo uninstall validate-config validate-manifest 2set -l hook_stages commit merge-commit prepare-commit-msg commit-msg post-commit manual post-checkout push post-merge post-rewrite 3set -l hook_types pre-commit pre-merge-commit pre-push prepare-commit-msg commit-msg post-commit post-checkout post-merge post-rewrite 4 5functions -q __fish_git|| complete -C"git " &> /dev/null 6 7function __fish_pre_commit_config_print -a key 8set -l config( __fish_git rev-parse --show-toplevel2> /dev/null) /.pre-commit-config.yaml 9test -r " $config " && string match -rg"\s+ $key :\s+(\S+)" < $config | string unescape 10end 11 12# Global options 13complete pre-commit -f 14complete pre-commit -n __fish_use_subcommand -s h -l help -d"Show help message and exit" 15complete pre-commit -n __fish_use_subcommand -s V -l version -d"Show version number and exit" 16complete pre-commit -n"__fish_seen_subcommand_from $commands " -l color -xa"auto always never" -d"Whether to use color in output" 17complete pre-commit -n"__fish_seen_subcommand_from $commands " -s c -l config -r -d"Path to alternate config file" 18complete pre-commit -n"__fish_seen_subcommand_from $commands " -s h -l help -d"Show help message and exit" 19 20# autoupdate 21complete pre-commit -n __fish_use_subcommand -a autoupdate -d"Auto-update config" 22complete pre-commit -n"__fish_seen_subcommand_from autoupdate" -l bleeding-edge -d"Update to the bleeding edge of `HEAD`" 23complete pre-commit -n"__fish_seen_subcommand_from autoupdate" -l freeze -d"Store frozen hashes in `rev`" 24complete pre-commit -n"__fish_seen_subcommand_from autoupdate" -l repo -xa"(__fish_pre_commit_config_print repo)" -d"Only update this repository" 25 26# clean 27complete pre-commit -n __fish_use_subcommand -a clean -d"Clean out files" 28 29# gc 30complete pre-commit -n __fish_use_subcommand -a gc -d"Clean unused cached repos" 31 32# help 33complete pre-commit -n __fish_use_subcommand -a help -d"Show help for a specific command" 34complete pre-commit -n"__fish_seen_subcommand_from help" -a" $commands " -d Command 35 36# init-templatedir 37complete pre-commit -n __fish_use_subcommand -a init-templatedir -d"Install hook script in a directory" 38complete pre-commit -n"__fish_seen_subcommand_from init-templatedir" -l no-allow-missing-config -d"Assume cloned repos should have a config" 39complete pre-commit -n"__fish_seen_subcommand_from init-templatedir" -s t -l hook-type -xa" $hook_types " -d"Type of hook to install" 40complete pre-commit -n"__fish_seen_subcommand_from init-templatedir" -a"(__fish_complete_directories)" -d"Directory to write scripts" 41 42# install 43complete pre-commit -n __fish_use_subcommand -a install -d"Install the pre-commit script" 44complete pre-commit -n"__fish_seen_subcommand_from install" -l allow-missing-config -d"Allow missing config file" 45complete pre-commit -n"__fish_seen_subcommand_from install" -l install-hooks -d"Install hook environments" 46complete pre-commit -n"__fish_seen_subcommand_from install" -s t -l hook-type -xa" $hook_types " -d"Type of hook to install" 47complete pre-commit -n"__fish_seen_subcommand_from install" -s f -l overwrite -d"Overwrite existing hooks" 48 49# install-hooks 50complete pre-commit -n __fish_use_subcommand -a install-hooks -d"Install all hook environments" 51 52# migrate-config 53complete pre-commit -n __fish_use_subcommand -a migrate-config -d"Migrate to newer config" 54 55# run / try-repo 56complete pre-commit -n __fish_use_subcommand -a run -d"Run hooks" 57complete pre-commit -n __fish_use_subcommand -a try-repo -d"Try the hooks in a repository" 58complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l checkout-type -xa"0 1" -d"Indicate either branch or file checkout" 59complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l commit-msg-filename -r -d"Filename to check when running during `commit-msg`" 60complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l commit-object-name -d"Commit object name" 61complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l files -r -d"Filenames to run hooks on" 62complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l hook-stage -xa" $hook_stages " -d"The stage during which the hook is fired" 63complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l is-squash-merge -d"Whether the merge was a squash merge" 64complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l local-branch -d"Local branch ref used by `git push`" 65complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l prepare-commit-message-source -d"Source of the commit message" 66complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l remote-branch -d"Remote branch ref used by `git push`" 67complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l remote-name -d"Remote name used by `git push`" 68complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l remote-url -d"Remote url used by `git push`" 69complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l rewrite-command -d"The command that invoked the rewrite" 70complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -l show-diff-on-failure -d"Show `git diff` on hook failure" 71complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -s a -l all-files -d"Run on all the files in the repo" 72complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -s s -l source -l from-ref -xa'(__fish_git_refs)' -d"Original ref" 73complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -s o -l origin -l to-ref -xa'(__fish_git_refs)' -d"Destination ref" 74complete pre-commit -n"__fish_seen_subcommand_from run try-repo" -s v -l verbose -d Verbose 75complete pre-commit -n"__fish_seen_subcommand_from run" -a"(__fish_pre_commit_config_print id)" -d"Hook id" 76complete pre-commit -n"__fish_seen_subcommand_from try-repo" -l ref -l rev -xa'(__fish_git_refs)' -d"Ref to run against" 77 78# sample-config 79complete pre-commit -n __fish_use_subcommand -a sample-config -d"Produce sample config file" 80 81# uninstall 82complete pre-commit -n __fish_use_subcommand -a uninstall -d"Uninstall the pre-commit script" 83complete pre-commit -n"__fish_seen_subcommand_from uninstall" -s t -l hook-type -xa" $hook_types " -d"Type of hook to uninstall" 84 85# validate-config 86complete pre-commit -n __fish_use_subcommand -a validate-config -d"Validate .pre-commit-config.yaml files" 87complete pre-commit -n"__fish_seen_subcommand_from validate-config" --force-files 88 89# validate-manifest 90complete pre-commit -n __fish_use_subcommand -a validate-manifest -d"Validate .pre-commit-hooks.yaml files" 91complete pre-commit -n"__fish_seen_subcommand_from validate-manifest" --force-files