diff --git a/src/_tarsnap b/src/_tarsnap new file mode 100644 index 0000000..efcc2c9 --- /dev/null +++ b/src/_tarsnap @@ -0,0 +1,35 @@ +#compdef tarsnap +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for the tarsnap command +# (http://www.tarsnap.com/man.html). +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Daniel Teunis +# + +_tarsnap(){ + local -a commands + commands=( + '--fsck:Perform some integrity checks on the archives stored' + '--fsck-prune:Perform integrity checks and prune broken data' + '--list-archives:Print the names of archives stored' + '--nuke:Delete all of the archives stored' + '--print-stats:Print global statistics concerning the archives stored' + '-c:Create an archive containing the specified items and name' + '-d:Delete the specified archive' + '-r:Read the specified archive, convert it to a tar stream, and write it to stdout' + '-t:List archive contents to stdout' + '-x:Extract to disk from the archive' + ) + + if (( CURRENT == 2 )); then + _describe -t commands 'commands' commands + fi + + return 0 +}