borg.fish 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. # Completions for borg version 1.1.1
  2. # https://www.borgbackup.org/
  3. # Note:
  4. # The list_archives function works on password protected repositories only if $BORG_PASSPHRASE is set.
  5. # Install:
  6. # Copy this file to /usr/share/fish/vendor_completions.d/
  7. # Commands
  8. complete -c borg -f -n __fish_is_first_token -a 'init' -d 'Initialize an empty repository'
  9. complete -c borg -f -n __fish_is_first_token -a 'create' -d 'Create new archive'
  10. complete -c borg -f -n __fish_is_first_token -a 'extract' -d 'Extract archive contents'
  11. complete -c borg -f -n __fish_is_first_token -a 'check' -d 'Check repository consistency'
  12. complete -c borg -f -n __fish_is_first_token -a 'rename' -d 'Rename an existing archive'
  13. complete -c borg -f -n __fish_is_first_token -a 'list' -d 'List archive or repository contents'
  14. complete -c borg -f -n __fish_is_first_token -a 'diff' -d 'Find differences between archives'
  15. complete -c borg -f -n __fish_is_first_token -a 'delete' -d 'Delete a repository or archive'
  16. complete -c borg -f -n __fish_is_first_token -a 'prune' -d 'Prune repository archives'
  17. complete -c borg -f -n __fish_is_first_token -a 'info' -d 'Show archive details'
  18. complete -c borg -f -n __fish_is_first_token -a 'mount' -d 'Mount archive or a repository'
  19. complete -c borg -f -n __fish_is_first_token -a 'umount' -d 'Un-mount the mounted archive'
  20. function __fish_borg_seen_key
  21. if __fish_seen_subcommand_from key
  22. and not __fish_seen_subcommand_from import export change-passphrase
  23. return 0
  24. end
  25. return 1
  26. end
  27. complete -c borg -f -n __fish_is_first_token -a 'key' -d 'Manage a repository key'
  28. complete -c borg -f -n __fish_borg_seen_key -a 'import' -d 'Import a repository key'
  29. complete -c borg -f -n __fish_borg_seen_key -a 'export' -d 'Export a repository key'
  30. complete -c borg -f -n __fish_borg_seen_key -a 'change-passphrase' -d 'Change key file passphrase'
  31. complete -c borg -f -n __fish_is_first_token -a 'serve' -d 'Start in server mode'
  32. complete -c borg -f -n __fish_is_first_token -a 'upgrade' -d 'Upgrade a repository'
  33. complete -c borg -f -n __fish_is_first_token -a 'recreate' -d 'Recreate contents of existing archives'
  34. complete -c borg -f -n __fish_is_first_token -a 'export-tar' -d 'Create tarball from an archive'
  35. complete -c borg -f -n __fish_is_first_token -a 'with-lock' -d 'Run a command while repository lock held'
  36. complete -c borg -f -n __fish_is_first_token -a 'break-lock' -d 'Break the repository lock'
  37. function __fish_borg_seen_benchmark
  38. if __fish_seen_subcommand_from benchmark
  39. and not __fish_seen_subcommand_from crud
  40. return 0
  41. end
  42. return 1
  43. end
  44. complete -c borg -f -n __fish_is_first_token -a 'benchmark' -d 'Benchmark borg operations'
  45. complete -c borg -f -n __fish_borg_seen_benchmark -a 'crud' -d 'Benchmark borg CRUD operations'
  46. # Common options
  47. complete -c borg -f -s h -l 'help' -d 'Show help information'
  48. complete -c borg -f -l 'version' -d 'Show version information'
  49. complete -c borg -f -l 'critical' -d 'Log level CRITICAL'
  50. complete -c borg -f -l 'error' -d 'Log level ERROR'
  51. complete -c borg -f -l 'warning' -d 'Log level WARNING (default)'
  52. complete -c borg -f -l 'info' -d 'Log level INFO'
  53. complete -c borg -f -s v -l 'verbose' -d 'Log level INFO'
  54. complete -c borg -f -l 'debug' -d 'Log level DEBUG'
  55. complete -c borg -f -l 'debug-topic' -d 'Enable TOPIC debugging'
  56. complete -c borg -f -s p -l 'progress' -d 'Show progress information'
  57. complete -c borg -f -l 'log-json' -d 'Output one JSON object per log line'
  58. complete -c borg -f -l 'lock-wait' -d 'Wait for lock max N seconds [1]'
  59. complete -c borg -f -l 'show-version' -d 'Log version information'
  60. complete -c borg -f -l 'show-rc' -d 'Log the return code'
  61. complete -c borg -f -l 'umask' -d 'Set umask to M [0077]'
  62. complete -c borg -l 'remote-path' -d 'Use PATH as remote borg executable'
  63. complete -c borg -f -l 'remote-ratelimit' -d 'Set remote network upload RATE limit'
  64. complete -c borg -f -l 'consider-part-files' -d 'Treat part files like normal files'
  65. complete -c borg -l 'debug-profile' -d 'Write execution profile into FILE'
  66. # borg init options
  67. set -l encryption_modes "none keyfile keyfile-blake2 repokey repokey-blake2 authenticated authenticated-blake2"
  68. complete -c borg -f -s e -l 'encryption' -d 'Encryption key MODE' -a "$encryption_modes" -n "__fish_seen_subcommand_from init"
  69. complete -c borg -f -l 'append-only' -d 'Create an append-only mode repository' -n "__fish_seen_subcommand_from init"
  70. complete -c borg -f -l 'storage-quota' -d 'Set storage QUOTA of the repository' -n "__fish_seen_subcommand_from init"
  71. # borg create options
  72. complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from create"
  73. complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from create"
  74. complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from create"
  75. complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from create"
  76. complete -c borg -f -l 'json' -d 'Print verbose stats as json' -n "__fish_seen_subcommand_from create"
  77. complete -c borg -f -l 'no-cache-sync' -d 'Do not synchronize the cache' -n "__fish_seen_subcommand_from create"
  78. complete -c borg -f -l 'no-files-cache' -d 'Do not load/update metadata cache' -n "__fish_seen_subcommand_from create"
  79. # Exclusion options
  80. complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create"
  81. complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from create"
  82. complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create"
  83. complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from create"
  84. complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from create"
  85. complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from create"
  86. complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from create"
  87. complete -c borg -f -l 'keep-tag-files' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from create"
  88. complete -c borg -f -l 'exclude-nodump' -d 'Exclude files flagged nodump' -n "__fish_seen_subcommand_from create"
  89. # Filesytem options
  90. complete -c borg -f -s x -l 'one-file-system' -d 'Stay in the same file system' -n "__fish_seen_subcommand_from create"
  91. complete -c borg -f -l 'numeric-owner' -d 'Only store numeric user:group identifiers' -n "__fish_seen_subcommand_from create"
  92. complete -c borg -f -l 'noatime' -d 'Do not store atime' -n "__fish_seen_subcommand_from create"
  93. complete -c borg -f -l 'noctime' -d 'Do not store ctime' -n "__fish_seen_subcommand_from create"
  94. complete -c borg -f -l 'nobsdflags' -d 'Do not store bsdflags' -n "__fish_seen_subcommand_from create"
  95. complete -c borg -f -l 'ignore-inode' -d 'Ignore inode data in file metadata cache' -n "__fish_seen_subcommand_from create"
  96. set -l files_cache_mode "ctime,size,inode mtime,size,inode ctime,size mtime,size rechunk,ctime rechunk,mtime disabled"
  97. complete -c borg -f -l 'files-cache' -d 'Operate files cache in MODE' -a "$files_cache_mode" -n "__fish_seen_subcommand_from create"
  98. complete -c borg -f -l 'read-special' -d 'Open device files like regular files' -n "__fish_seen_subcommand_from create"
  99. # Archive options
  100. complete -c borg -f -l 'comment' -d 'Add COMMENT to the archive' -n "__fish_seen_subcommand_from create"
  101. complete -c borg -f -l 'timestamp' -d 'Set creation TIME (yyyy-mm-ddThh:mm:ss)' -n "__fish_seen_subcommand_from create"
  102. complete -c borg -l 'timestamp' -d 'Set creation time by reference FILE' -n "__fish_seen_subcommand_from create"
  103. complete -c borg -f -s c -l 'checkpoint-interval' -d 'Write checkpoint every N seconds [1800]' -n "__fish_seen_subcommand_from create"
  104. complete -c borg -f -l 'chunker-params' -d 'Chunker PARAMETERS [19,23,21,4095]' -n "__fish_seen_subcommand_from create"
  105. set -l compression_methods "none auto lz4 zlib,1 zlib,2 zlib,3 zlib,4 zlib,5 zlib,6 zlib,7 zlib,8 zlib,9 lzma,0 lzma,1 lzma,2 lzma,3 lzma,4 lzma,5 lzma,6 lzma,7 lzma,8 lzma,9"
  106. complete -c borg -f -s C -l 'compression' -d 'Select compression ALGORITHM,LEVEL [lz4]' -a "$compression_methods" -n "__fish_seen_subcommand_from create"
  107. # borg extract options
  108. complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from extract"
  109. complete -c borg -f -s n -l 'dry-run' -d 'Do not actually extract any files' -n "__fish_seen_subcommand_from extract"
  110. complete -c borg -f -l 'numeric-owner' -d 'Only obey numeric user:group identifiers' -n "__fish_seen_subcommand_from extract"
  111. complete -c borg -f -l 'nobsdflags' -d 'Do not extract bsdflags' -n "__fish_seen_subcommand_from extract"
  112. complete -c borg -f -l 'stdout' -d 'Write all extracted data to stdout' -n "__fish_seen_subcommand_from extract"
  113. complete -c borg -f -l 'sparse' -d 'Create holes in sparse file' -n "__fish_seen_subcommand_from extract"
  114. # Exclusion options
  115. complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from extract"
  116. complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from extract"
  117. complete -c borg -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from extract"
  118. complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from extract"
  119. complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from extract"
  120. # borg check options
  121. complete -c borg -f -l 'repository-only' -d 'Only perform repository checks' -n "__fish_seen_subcommand_from check"
  122. complete -c borg -f -l 'archives-only' -d 'Only perform archives checks' -n "__fish_seen_subcommand_from check"
  123. complete -c borg -f -l 'verify-data' -d 'Cryptographic integrity verification' -n "__fish_seen_subcommand_from check"
  124. complete -c borg -f -l 'repair' -d 'Attempt to repair found inconsistencies' -n "__fish_seen_subcommand_from check"
  125. complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from check"
  126. # Archive filters
  127. complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from check"
  128. complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from check"
  129. set -l sort_keys "timestamp name id"
  130. complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from check"
  131. complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from check"
  132. complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from check"
  133. # borg rename
  134. # no specific options
  135. # borg list options
  136. complete -c borg -f -l 'short' -d 'Only print file/directory names' -n "__fish_seen_subcommand_from list"
  137. complete -c borg -f -l 'list-format' -d 'Specify FORMAT for file listing' -n "__fish_seen_subcommand_from list"
  138. complete -c borg -f -l 'format' -d 'Specify FORMAT for file listing' -n "__fish_seen_subcommand_from list"
  139. complete -c borg -f -l 'json' -d 'List contents in json format' -n "__fish_seen_subcommand_from list"
  140. complete -c borg -f -l 'json-lines' -d 'List contents in json lines format' -n "__fish_seen_subcommand_from list"
  141. # Archive filters
  142. complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from list"
  143. complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from list"
  144. complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from list"
  145. complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from list"
  146. complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from list"
  147. # Exclusion options
  148. complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from list"
  149. complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from list"
  150. complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from list"
  151. complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from list"
  152. complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from list"
  153. complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from list"
  154. # FIXME are these options really part of borg list?
  155. complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from list"
  156. complete -c borg -f -l 'keep-tag-files' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from list"
  157. # borg diff options
  158. complete -c borg -f -l 'numeric-owner' -d 'Only consider numeric user:group' -n "__fish_seen_subcommand_from diff"
  159. complete -c borg -f -l 'same-chunker-params' -d 'Override check of chunker parameters' -n "__fish_seen_subcommand_from diff"
  160. complete -c borg -f -l 'sort' -d 'Sort the output lines by file path' -n "__fish_seen_subcommand_from diff"
  161. # Exclusion options
  162. complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from diff"
  163. complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from diff"
  164. complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from diff"
  165. complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from diff"
  166. complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from diff"
  167. complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from diff"
  168. # FIXME are these options really part of borg diff?
  169. complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from diff"
  170. complete -c borg -f -l 'keep-tag-files' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from diff"
  171. # borg delete options
  172. complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from delete"
  173. complete -c borg -f -l 'cache-only' -d "Delete only the local cache" -n "__fish_seen_subcommand_from delete"
  174. complete -c borg -f -l 'force' -d 'Force deletion of corrupted archives' -n "__fish_seen_subcommand_from delete"
  175. complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from delete"
  176. # Archive filters
  177. complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from delete"
  178. complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from delete"
  179. complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from delete"
  180. complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from delete"
  181. complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from delete"
  182. # borg prune options
  183. complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from prune"
  184. complete -c borg -f -l 'force' -d 'Force pruning of corrupted archives' -n "__fish_seen_subcommand_from prune"
  185. complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from prune"
  186. complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from prune"
  187. complete -c borg -f -l 'keep-within' -d 'Keep archives within time INTERVAL' -n "__fish_seen_subcommand_from prune"
  188. complete -c borg -f -l 'keep-last' -d 'NUMBER of secondly archives to keep' -n "__fish_seen_subcommand_from prune"
  189. complete -c borg -f -l 'keep-secondly' -d 'NUMBER of secondly archives to keep' -n "__fish_seen_subcommand_from prune"
  190. complete -c borg -f -l 'keep-minutely' -d 'NUMBER of minutely archives to keep' -n "__fish_seen_subcommand_from prune"
  191. complete -c borg -f -s H -l 'keep-hourly' -d 'NUMBER of hourly archives to keep' -n "__fish_seen_subcommand_from prune"
  192. complete -c borg -f -s d -l 'keep-daily' -d 'NUMBER of daily archives to keep' -n "__fish_seen_subcommand_from prune"
  193. complete -c borg -f -s w -l 'keep-weekly' -d 'NUMBER of weekly archives to keep' -n "__fish_seen_subcommand_from prune"
  194. complete -c borg -f -s m -l 'keep-monthly' -d 'NUMBER of monthly archives to keep' -n "__fish_seen_subcommand_from prune"
  195. complete -c borg -f -s y -l 'keep-yearly' -d 'NUMBER of yearly archives to keep' -n "__fish_seen_subcommand_from prune"
  196. complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from prune"
  197. # Archive filters
  198. complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from prune"
  199. complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from prune"
  200. # borg info options
  201. complete -c borg -f -l 'json' -d 'Format output in json format' -n "__fish_seen_subcommand_from info"
  202. # Archive filters
  203. complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from info"
  204. complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from info"
  205. complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from info"
  206. complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from info"
  207. complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from info"
  208. # borg mount options
  209. complete -c borg -f -s f -l 'foreground' -d 'Stay in foreground, do not daemonize' -n "__fish_seen_subcommand_from mount"
  210. set -l fuse_options "allow_other allow_root" # FIXME there are lot more options, but not all are applicable
  211. complete -c borg -f -s o -d 'Fuse mount OPTIONS' -a "$fuse_options" -n "__fish_seen_subcommand_from mount"
  212. # Archive filters
  213. complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from mount"
  214. complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from mount"
  215. complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from mount"
  216. complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from mount"
  217. complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from mount"
  218. # borg umount
  219. # no specific options
  220. # borg key change-passphrase
  221. # no specific options
  222. # borg key export
  223. complete -c borg -f -l 'paper' -d 'Create an export for printing' -n "__fish_seen_subcommand_from export"
  224. complete -c borg -f -l 'qr-html' -d 'Create an html file for printing and qr' -n "__fish_seen_subcommand_from export"
  225. # borg key import
  226. complete -c borg -f -l 'paper' -d 'Import from a backup done with --paper' -n "__fish_seen_subcommand_from import"
  227. # borg upgrade
  228. complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from upgrade"
  229. complete -c borg -f -l 'inplace' -d 'Rewrite repository in place' -n "__fish_seen_subcommand_from upgrade"
  230. complete -c borg -f -l 'force' -d 'Force upgrade' -n "__fish_seen_subcommand_from upgrade"
  231. complete -c borg -f -l 'tam' -d 'Enable manifest authentication' -n "__fish_seen_subcommand_from upgrade"
  232. complete -c borg -f -l 'disable-tam' -d 'Disable manifest authentication' -n "__fish_seen_subcommand_from upgrade"
  233. # borg recreate
  234. complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from recreate"
  235. complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from recreate"
  236. complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from recreate"
  237. complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from recreate"
  238. # Exclusion options
  239. complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
  240. complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from recreate"
  241. complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
  242. complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from recreate"
  243. complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from recreate"
  244. complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from recreate"
  245. complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from recreate"
  246. complete -c borg -f -l 'keep-tag-files' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from recreate"
  247. # Archive options
  248. complete -c borg -f -l 'target' -d "Create a new ARCHIVE" -n "__fish_seen_subcommand_from recreate"
  249. complete -c borg -f -s c -l 'checkpoint-interval' -d 'Write checkpoint every N seconds [1800]' -n "__fish_seen_subcommand_from recreate"
  250. complete -c borg -f -l 'comment' -d 'Add COMMENT to the archive' -n "__fish_seen_subcommand_from recreate"
  251. complete -c borg -f -l 'timestamp' -d 'Set creation TIME (yyyy-mm-ddThh:mm:ss)' -n "__fish_seen_subcommand_from recreate"
  252. complete -c borg -l 'timestamp' -d 'Set creation time using reference FILE' -n "__fish_seen_subcommand_from recreate"
  253. complete -c borg -f -s C -l 'compression' -d 'Select compression ALGORITHM,LEVEL [lz4]' -a "$compression_methods" -n "__fish_seen_subcommand_from recreate"
  254. set -l recompress_when "if-different always"
  255. complete -c borg -f -l 'recompress' -d 'Recompress chunks CONDITION' -a "$recompress_when" -n "__fish_seen_subcommand_from recreate"
  256. complete -c borg -f -l 'chunker-params' -d 'Chunker PARAMETERS [19,23,21,4095]' -n "__fish_seen_subcommand_from recreate"
  257. # borg export-tar options
  258. complete -c borg -l 'tar-filter' -d 'Filter program to pipe data through' -n "__fish_seen_subcommand_from export-tar"
  259. complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from export-tar"
  260. # Exclusion options
  261. complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
  262. complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from recreate"
  263. complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
  264. complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from recreate"
  265. complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from recreate"
  266. # borg serve
  267. complete -c borg -l 'restrict-to-path' -d 'Restrict repository access to PATH' -n "__fish_seen_subcommand_from serve"
  268. complete -c borg -l 'restrict-to-repository' -d 'Restrict repository access at PATH' -n "__fish_seen_subcommand_from serve"
  269. complete -c borg -f -l 'append-only' -d 'Only allow appending to repository' -n "__fish_seen_subcommand_from serve"
  270. complete -c borg -f -l 'storage-quota' -d 'Override storage QUOTA of the repository' -n "__fish_seen_subcommand_from serve"
  271. # borg with-lock
  272. # no specific options
  273. # borg break-lock
  274. # no specific options
  275. # borg benchmark
  276. # no specific options
  277. # List archives
  278. function __fish_borg_is_repository
  279. return (string match --quiet --regex '.*::' '"'(commandline --current-token)'"')
  280. end
  281. function __fish_borg_list_archives
  282. set -l repository_name (string replace --regex '::.*' '' (commandline --current-token))
  283. borg list --format="$repository_name::{archive}{NEWLINE}" "$repository_name" ^/dev/null
  284. end
  285. complete -c borg -f -n __fish_borg_is_repository -a '(__fish_borg_list_archives)'