fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
c7262d6c0
master
1# fish completion for t-rec (https://github.com/sassman/t-rec-rs 2 3function __fish_t_rec_time_unit 4set -l cur( commandline --current-token) 5if string match -qr'^\d+$' --$cur 6echo $cur "ms"\t"milliseconds" 7echo $cur "s"\t"seconds" 8echo $cur "m"\t"minutes" 9end 10end 11 12function __fish_t_rec_window_list 13string replace -r --'\s*(.*)\|\s+(\d+)' '$2\t$1' ( t-rec --ls| tail -n+2 ) 14end 15 16# Options 17complete -c t-rec -d"Command to run instead of shell" -xa"(complete -C '' | string split \t -f1)" 18complete -c t-rec -s v -l verbose -d"Enable verbose insights for the curious" 19complete -c t-rec -s q -l quiet -d"Quiet mode, suppresses the banner" 20complete -c t-rec -s m -l video -d"Generate both gif and mp4 video" 21complete -c t-rec -s M -l video-only -d"Generate only mp4 video, not gif" 22complete -c t-rec -s d -l decor -d"Decorate animation" -xa"shadow none" 23complete -c t-rec -s b -l bg -d"Background color when decors are used" -xa"white black transparent" 24complete -c t-rec -s n -l natural -d"Natural typing, disables idle detection and sampling optimization" 25complete -c t-rec -s l -l ls -d"List windows available for recording by their id" 26complete -c t-rec -s w -l win-id -d"Id of window to capture" -xa"(__t_rec_window_list)" 27complete -c t-rec -s e -l end-pause -d"Pause time at end of animation" -xa"(__fish_t_rec_time_unit)" -r 28complete -c t-rec -s s -l start-pause -d"Pause time at start of animation" -xa"(__fish_t_rec_time_unit)" -r 29complete -c t-rec -s o -l output -d"Output file (without extension); defaults to t-rec" -r 30complete -c t-rec -s h -l help -d"Print help" 31complete -c t-rec -s V -l version -d"Print version"