fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
78c948282
master
1function __fish_complete_tar -d"Peek inside of archives and list all files" 2set -l args( commandline -pxc) 3while count $args > /dev/null 4switch $args [ 1 ] 5case '-*f' --file 6set -e args[ 1 ] 7if test -f $args [ 1 ] 8set -l file_list( tar -atf$args [ 1 ] 2> /dev/null) 9if test -n " $file_list " 10printf "%s\tArchived file\n" $file_list 11end 12return 13end 14case '*' 15set -e args[ 1 ] 16continue 17end 18end 19end 20 21complete -c tar -a"(__fish_complete_tar)" 22 23## Operation mode 24complete -c tar -s A -l catenate -l concatenate -d"Append archive to archive" 25complete -c tar -s c -l create -d"Create archive" 26complete -c tar -s d -l diff -l compare -d"Compare archive and filesystem" 27complete -c tar -l delete -d"Delete from archive" 28complete -c tar -s r -l append -d"Append files to archive" 29complete -c tar -s t -l list -d"List archive" 30complete -c tar -l test-label -d"Test the archive volume label" 31complete -c tar -s u -l update -d"Append new files" 32complete -c tar -s x -l extract -l get -d"Extract from archive" 33complete -c tar -l show-defaults -d"Show built-in defaults for various tar options" 34complete -c tar -s\? -l help -d"Display short option summary" 35complete -c tar -l usage -d"List available options" 36complete -c tar -l version -d"Print program version and copyright information" 37 38## Operation modifiers 39 40complete -c tar -l check-device -d"Check device numbers when creating incremental archives" 41complete -c tar -s g -l listed-incremental -r -d"Handle new GNU-format incremental backups" 42complete -c tar -l hole-detection -x -a"seek raw" -d"Use METHOD to detect holes in sparse files" 43complete -c tar -s G -l incremental -d"Use old incremental GNU format" 44complete -c tar -l ignore-failed-read -d"Do not exit with nonzero on unreadable files" 45complete -c tar -l level -x -a0 -d"Set dump level for a created listed-incremental archive" 46complete -c tar -s n -l seek -d"Assume the archive is seekable" 47complete -c tar -l no-check-device -d"Do not check device numbers when creating incremental archives" 48complete -c tar -l no-seek -d"Assume the archive is not seekable" 49complete -c tar -l occurrence -r -d"Process only the Nth occurrence of each file in the archive" 50complete -c tar -l restrict -d"Disable the use of some potentially harmful options" 51complete -c tar -l sparse-version -x -a"0.0 0.1 1.0" -d"Set which version of the sparse format to use" 52complete -c tar -s S -l sparse -d"Handle sparse files" 53 54## Overwrite control 55complete -c tar -s k -l keep-old-files -d"Don't overwrite" 56complete -c tar -l keep-newer-files -d"Don't replace existing files that are newer" 57complete -c tar -l keep-directory-symlink -d"Don't replace existing symlinks" 58complete -c tar -l no-overwrite-dir -d"Preserve metadata of existing directories" 59complete -c tar -l one-top-level -d"Extract into directory" 60complete -c tar -l overwrite -d"Overwrite existing files when extracting" 61complete -c tar -l overwrite-dir -d"Overwrite metadata of existing directories" 62complete -c tar -l recursive-unlink -d"Recursively remove all files in the directory prior to extracting it" 63complete -c tar -l remove-files -d"Remove files after adding to archive" 64complete -c tar -l skip-old-files -d"Don't replace existing files when extracting" 65complete -c tar -s U -l unlink-first -d"Remove each file prior to extracting over it" 66complete -c tar -s W -l verify -d"Verify archive" 67 68## Output stream selection 69 70complete -c tar -l ignore-command-error -d"Ignore subprocess exit codes" 71complete -c tar -l no-ignore-command-error -d"Treat non-zero exit codes of children as error" 72complete -c tar -s O -l to-stdout -d"Extract to stdout" 73complete -c tar -l to-command -r -d"Pipe extracted files to COMMAND" 74 75## Handling of file attributes 76 77complete -c tar -l atime-preserve -d"Keep access time" 78complete -c tar -l delay-directory-restore -d"Delay setting modification times" 79complete -c tar -l group -x -d"Force NAME as group for added files" 80complete -c tar -l group-map -r -d"Read group translation map from FILE" 81complete -c tar -l mode -x -d"Force symbolic mode CHANGES for added files" 82complete -c tar -l mtime -r -d"Set mtime for added files" 83complete -c tar -s m -l touch -d"Don't extract modification time" 84complete -c tar -l no-delay-directory-restore -d"Cancel the effect of the prior --delay-directory-restore" 85complete -c tar -l no-same-owner -d"Extract files as yourself" 86complete -c tar -l no-same-permissions -d"Apply the user's umask when extracting" 87complete -c tar -l numeric-owner -d"Always use numbers for user/group names" 88complete -c tar -l owner -x -d"Force NAME as owner for added files" 89complete -c tar -l owner-map -r -d"Read owner translation map from FILE" 90complete -c tar -s p -l same-permissions -l preserve-permissions -d"Extract all permissions" 91complete -c tar -l same-owner -d"Try extracting files with the same ownership" 92complete -c tar -s s -l same-order -l preserve-order -d"Do not sort file arguments" 93complete -c tar -l sort -x -a"none name inode" -d"sort directory entries according to ORDER" 94 95## Extended file attributes 96 97complete -c tar -l acls -d"Enable POSIX ACLs support" 98complete -c tar -l no-acls -d"Disable POSIX ACLs support" 99complete -c tar -l selinux -d"Enable SELinux context support" 100complete -c tar -l no-selinux -d"Disable SELinux context support" 101complete -c tar -l xattrs -d"Enable extended attributes support" 102complete -c tar -l no-xattrs -d"Disable extended attributes support" 103complete -c tar -l xattrs-exclude -d"Specify the exclude pattern for xattr keys" 104complete -c tar -l xattrs-include -d"Specify the include pattern for xattr keys" 105 106## Device selection and switching 107complete -c tar -s f -l file -r -d"Archive file" 108complete -c tar -l force-local -r -d"Archive file is local even if it has a colon" 109complete -c tar -s F -l info-script -l new-volume-script -r -d"Run script at end of tape" 110complete -c tar -s L -l tape-length -r -d"Tape length" 111complete -c tar -s M -l multi-volume -d"Multi volume archive" 112complete -c tar -l rmt-command -r -d"Use COMMAND instead of rmt" 113complete -c tar -l rsh-command -r -d"Use COMMAND instead of rsh" 114complete -c tar -l volno-file -r -d"keep track of which volume of a multi-volume archive it is working in FILE" 115 116complete -c tar -s f -l file -r -d"Archive file" 117complete -c tar -s f -l file -r -d"Archive file" 118complete -c tar -s f -l file -r -d"Archive file" 119 120complete -c tar -s b -l block-size -d"Block size" 121complete -c tar -s B -l read-full-blocks -d"Reblock while reading" 122complete -c tar -s C -l directory -r -d"Change directory" 123complete -c tar -l checkpoint -d"Print directory names" 124complete -c tar -l force-local -d"Archive is local" 125complete -c tar -s h -l dereference -d"Dereference symlinks" 126complete -c tar -s i -l ignore-zeros -d"Ignore zero block in archive" 127complete -c tar -s K -l starting-file -r -d"Starting file in archive" 128complete -c tar -s l -l one-file-system -d"Stay in local filesystem" 129complete -c tar -s m -l modification-time -d"Don't extract modification time" 130complete -c tar -s N -l after-date -r -d"Only store newer files" 131complete -c tar -l newer -r -d"Only store newer files" 132complete -c tar -s o -l old-archive -d"Use V7 format" 133complete -c tar -l portability -d"Use V7 format" 134complete -c tar -s P -l absolute-paths -d"Don't strip leading /" 135complete -c tar -l preserve -d"Preserve all permissions and do not sort file arguments" 136complete -c tar -s R -l record-number -d"Show record number" 137complete -c tar -s T -l files-from -r -d"Extract file from file" 138complete -c tar -l null -d"-T has null-terminated names" 139complete -c tar -l totals -d"Print total bytes written" 140complete -c tar -s v -l verbose -d"Verbose mode" 141complete -c tar -s V -l label -r -d"Set volume name" 142complete -c tar -s w -l interactive -d"Ask for confirmation" 143complete -c tar -l confirmation -d"Ask for confirmation" 144complete -c tar -l exclude -r -d"Exclude file" 145complete -c tar -s X -l exclude-from -r -d"Exclude files listed in specified file" 146 147## Compression options 148complete -c tar -s a -l auto-compress -d"Use archive suffix to determine the compression program" 149complete -c tar -s I -l use-compress-program -r -d"Filter through specified program" 150complete -c tar -s j -l bzip2 -d"Filter through bzip2" 151complete -c tar -s J -l xz -d"Filter through xz" 152complete -c tar -l lzip -d"Filter through lzip" 153complete -c tar -l lzma -d"Filter through lzma" 154complete -c tar -l lzop -d"Filter through lzop" 155complete -c tar -l no-auto-compress -d"Do not use archive suffix to determine the compression program" 156complete -c tar -s z -l gzip -l gunzip -l ungzip -d"Filter through gzip" 157complete -c tar -s Z -l compress -l uncompress -d"Filter through compress" 158complete -c tar -l zstd -d"Filter through zstd"