fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
73b13315d
master
1complete -c dd -xa'(__fish_complete_dd)' 2complete -c dd -d'display help and exit' -xa --help 3complete -c dd -d'output version information and exit' -xa --version 4 5function __fish_complete_dd -d'Complete dd operands' 6# set operand_string as a local variable containing the current command-line token. 7set -l operand_string( commandline -t) 8 9switch $operand_string 10case 'if=*' 'of=*' 11string replace =' ' --$operand_string | read -l operand value 12 13# Use normal file completions. 14printf " $operand =%s\n" ( complete -C"__fish_command_without_completions $value " ) 15 16case 'iflag=*' 'oflag=*' 17string replace =' ' --$operand_string | read -l operand complete 18string match -q'*,' --$complete 19or set complete'' 20 21printf "%s\t%s\n" " $operand = $complete ""append" "append mode (makes sense only for output; conv=notrunc suggested)" 22printf "%s\t%s\n" " $operand = $complete ""direct" "use direct I/O for data" 23printf "%s\t%s\n" " $operand = $complete ""directory" "fail unless a directory" 24printf "%s\t%s\n" " $operand = $complete ""dsync" "use synchronized I/O for data" 25printf "%s\t%s\n" " $operand = $complete ""sync" "use synchronized I/O for data and metadata" 26printf "%s\t%s\n" " $operand = $complete ""fullblock" "accumulate full blocks of input (iflag only)" 27printf "%s\t%s\n" " $operand = $complete ""nonblock" "use non-blocking I/O" 28printf "%s\t%s\n" " $operand = $complete ""noatime" "do not update access time" 29printf "%s\t%s\n" " $operand = $complete ""nocache" "discard cached data" 30printf "%s\t%s\n" " $operand = $complete ""noctty" "do not assign controlling terminal from file" 31printf "%s\t%s\n" " $operand = $complete ""nofollow" "do not follow symbolic links" 32 33case 'conv=*' 34string replace =' ' --$operand_string | read -l operand complete 35string match -q'*,' --$complete 36or set complete'' 37 38printf "%s\t%s\n" " $operand = $complete ""ascii" "from EBCDIC to ASCII" 39printf "%s\t%s\n" " $operand = $complete ""ebcdic" "from ASCII to EBCDIC" 40printf "%s\t%s\n" " $operand = $complete ""ibm" "from ASCII to alternate EBCDIC" 41printf "%s\t%s\n" " $operand = $complete ""block" "pad newline-terminated records with spaces to cbs-size" 42printf "%s\t%s\n" " $operand = $complete ""unblock" "replace trailing spaces in cbs-size records with newline" 43printf "%s\t%s\n" " $operand = $complete ""lcase" "change upper case to lower case" 44printf "%s\t%s\n" " $operand = $complete ""ucase" "change lower case to upper case" 45printf "%s\t%s\n" " $operand = $complete ""swab" "swap every pair of input bytes" 46printf "%s\t%s\n" " $operand = $complete ""sync" "pad every input block with NULs to ibs-size; with block or ublock use spaces" 47printf "%s\t%s\n" " $operand = $complete ""excl" "fail if the output file already exists" 48printf "%s\t%s\n" " $operand = $complete ""nocreat" "do not create the output file" 49printf "%s\t%s\n" " $operand = $complete ""notrunc" "do not truncate the output file" 50printf "%s\t%s\n" " $operand = $complete ""noerror" "continue after read errors" 51printf "%s\t%s\n" " $operand = $complete ""fdatasync" "physically write output file data before finishing" 52printf "%s\t%s\n" " $operand = $complete ""fsync" "physically write output file data and metadata before finishing" 53 54case 'status=*' 55printf "%s\t%s\n" status=noxfer"suppress final transfer statistics" 56printf "%s\t%s\n" status=none"suppress everything but errors" 57printf "%s\t%s\n" status=progress"show periodic transfer statistics" 58 59case '*' 60printf "%s=\t%s\n" bs"read and write up to BYTES bytes at a time" 61printf "%s=\t%s\n" cbs"convert BYTES bytes at a time" 62printf "%s=\t%s\n" conv"convert the file as per the comma separated symbol list" 63printf "%s=\t%s\n" count"copy only BLOCKS input blocks" 64printf "%s=\t%s\n" ibs"read up to BYTES bytes at a time (default 512)" 65printf "%s=\t%s\n" if"read from FILE instead of stdin" 66printf "%s=\t%s\n" iflag"read as per the comma separated symbol list" 67printf "%s=\t%s\n" obs"write BYTES bytes at a time (default 512)" 68printf "%s=\t%s\n" of"write to FILE instead of stdout" 69printf "%s=\t%s\n" oflag"write as per the comma separated symbol list" 70printf "%s=\t%s\n" seek"skip BLOCKS obs-sized blocks at the start of output" 71printf "%s=\t%s\n" skip"skip BLOCKS ibs-sized blocks at the start of input" 72printf "%s=\t%s\n" status"set the level of information to print to stderr" 73end 74end