fuzz-run-command (436B)
1 #!/usr/bin/env bash 2 3 function fuzz_runner() { 4 local prefix 5 local res 6 local get_cmd 7 local fhist 8 local cmd 9 if [ -n "$1" ]; then 10 prefix="$1" 11 shift 12 fi 13 res=$($FUZZER +i --select-1 --exit-0 -q ^$prefix < $HOME/dotfiles/commands) && 14 get_cmd=$(cutt -f3 <<<"$res") || return 15 get_cmd="$get_cmd $@" 16 cmd="$(eval $get_cmd)" 17 fuzz-record-command "$cmd" 18 if [ -n "$cmd" ]; then 19 echo "$cmd" 20 fi 21 } 22 23 fuzz_runner "$@"