fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a9618477e
master
1function __fish_watchexec_print_remaining_args 2set -l spec w/watch= c/clear='?' o/on-busy-update= r/restart s/signal= stop-signal= stop-timeout= d/debounce= stdin-quit no-vcs-ignore no-project-ignore no-global-ignore no-default-ignore no-discover-ignore p/postpone delay-run= poll= shell= n no-environment emit-events-to= E/env= no-process-group N/notify project-origin= workdir= e/exts= f/filter= filter-file= i/ignore= ignore-file= fs-events= no-meta print-events v/verbose log-file= manual h/help V/version 3 4set argv( commandline -xpc| string escape) ( commandline -ct) 5set -e argv[ 1 ] 6 7argparse -s$spec --$argv 2> /dev/null 8 9# The remaining argv is the subcommand with all its options, which is what 10# we want. 11if set -q argv[ 1 ] 12and not string match -qr'^-.*' --$argv [ 1 ] 13string join0 --$argv 14return 0 15else 16return 1 17end 18end 19 20function __fish_watchexec_complete_subcommand 21set -l args( __fish_watchexec_print_remaining_args | string split0) 22complete -C" $args " 23end 24 25function __fish_watchexec_at_argfile 26set -l current( commandline -ct) 27if test ( count ( commandline -xpc)) -eq 1 28and string match -q'@*' --$current 29 30set current( string sub -s2 --$current ) 31__fish_complete_path | string replace -r"^" @ 32return 0 33end 34return 1 35end 36 37complete -c watchexec -n __fish_watchexec_at_argfile -x -a"(__fish_watchexec_at_argfile)" 38 39complete -c watchexec -x -a"(__fish_watchexec_complete_subcommand)" 40 41complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sw -lwatch -r -d"Watch a specific file or directory" 42complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sc -lclear -fa reset -d"Clear screen before running command" 43complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -so -lon-busy-update -r -xa"queue do-nothinig restart signal" -d"What to do when receiving events while the command is running" 44complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sr -lrestart -d"Restart the process if it's still running" 45complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -ss -lsignal -r -f -d"Send a signal to the process when it's still running" 46complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lstop-signal -r -f -d"Signal to send to sstop the command" 47complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lstop-timeout -r -f -d"Time to wait for the command to exit gracefully" 48complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sd -ldebounce -r -f -d"Time to wait for new events before taking action" 49complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lstdin-quit -d"Exit when stding closes" 50complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-vcs-ignore -d"Don't load gitignores" 51complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-project-ignore -d"Don't load project-local ignores" 52complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-global-ignore -d"Don't load global ignores" 53complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-default-ignore -d"Don't use internal default ignores" 54complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-discover-ignore -d"Don't discover ignore files at all" 55complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sp -lpostpone -d"Wait until first change before running command" 56complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -ldelay-run -r -f -d"Sleep before running the command" 57complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lpoll -r -f -d"Poll for filesystem changes" 58complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lshell -r -fa"(printf 'none\tDon\'t use a shell\n';string match -r '^[^#].*' < /etc/shells)" -d"Use a different shell" 59complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -ln -d"Don#t use a shell" 60complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-environment -d"--emit-events=none" 61complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lemit-events-to -r -fa"environment stdin file json-stdin json-file none" -d"Configure event emission" 62complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sE -lenv -r -f -d"Add env vars to the command" 63complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-process-group -d"Don't use a process group" 64complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sN -lnotify -d"Alert when commands start and end" 65complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lproject-origin -r -fa"(__fish_complete_directories)" -d"Set the project origin" 66complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lworkdir -r -fa"(__fish_complete_directories)" -d"Set the working directory" 67complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -se -lexts -r -f -d"Filename extensions to filter to" 68complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sf -lfilter -r -f -d"Filename patterns to filter to" 69complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lfilter-file -r -d"Files to load filters from" 70complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -si -lignore -r -f -d"Filename patterns to filter out" 71complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lignore-file -r -d"Files to load ignores from" 72complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lfs-events -r -fa"access create remove rename modify metadata" -d"Filesystem events to filter to" 73complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lno-meta -d"Filesystem events to filter to" 74complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lprint-events -d"Print events that trigger actions" 75complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sv -lverbose -d"Set diagnostic log level" 76complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -llog-file -r -d"Write diagnostic logs to a file" 77complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -lmanual -d"Show the manual page" 78complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sh -lhelp -d"Print help (see a summary with '-h')" 79complete -c watchexec -n"not __fish_watchexec_print_remaining_args" -sV -lversion -d"Print version"