Shell completions reflect latest changes

This commit is contained in:
SanskritFritz 2018-06-22 23:53:44 +02:00
parent 125049f755
commit 46a5db7de8
3 changed files with 30 additions and 13 deletions

View File

@ -71,7 +71,7 @@ _borg()
local opts="-e --encryption --append-only --storage-quota ${common_opts}" local opts="-e --encryption --append-only --storage-quota ${common_opts}"
;; ;;
*' create '*) *' create '*)
local opts="-n --dry-run -s --stats --list --filter --json --no-cache-sync -e --exclude --exclude-from --pattern --patterns-from --exclude-caches --exclude-if-present --keep-exclude-tags --keep-tag-files --exclude-nodump -x --one-file-system --numeric-owner --noatime --noctime --nobirthtime --nobsdflags --ignore-inode --files-cache --read-special --comment --timestamp -c --checkpoint-interval --chunker-params -C --compression ${common_opts}" local opts="-n --dry-run -s --stats --list --filter --json --no-cache-sync --stdin-name -e --exclude --exclude-from --pattern --patterns-from --exclude-caches --exclude-if-present --keep-exclude-tags --keep-tag-files --exclude-nodump -x --one-file-system --numeric-owner --noatime --noctime --nobirthtime --nobsdflags --ignore-inode --files-cache --read-special --comment --timestamp -c --checkpoint-interval --chunker-params -C --compression ${common_opts}"
;; ;;
*' extract '*) *' extract '*)
local opts="--list -n --dry-run --numeric-owner --nobsdflags --stdout --sparse -e --exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}" local opts="--list -n --dry-run --numeric-owner --nobsdflags --stdout --sparse -e --exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}"
@ -88,7 +88,7 @@ _borg()
local opts="--numeric-owner --same-chunker-params --sort -e --exclude --exclude-from --pattern --patterns-from ${common_opts}" local opts="--numeric-owner --same-chunker-params --sort -e --exclude --exclude-from --pattern --patterns-from ${common_opts}"
;; ;;
*' delete '*) *' delete '*)
local opts="-s --stats --cache-only --force --save-space -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}" local opts="-n --dry-run -s --stats --cache-only --force --save-space -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}"
;; ;;
*' prune '*) *' prune '*)
local opts="-n --dry-run --force -s --stats --list --keep-within --keep-last --keep-secondly --keep-minutely -H --keep-hourly -d --keep-daily -w --keep-weekly -m --keep-monthly -y --keep-yearly --save-space -P --prefix -a --glob-archives ${common_opts}" local opts="-n --dry-run --force -s --stats --list --keep-within --keep-last --keep-secondly --keep-minutely -H --keep-hourly -d --keep-daily -w --keep-weekly -m --keep-monthly -y --keep-yearly --save-space -P --prefix -a --glob-archives ${common_opts}"
@ -97,7 +97,7 @@ _borg()
local opts="--json -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}" local opts="--json -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}"
;; ;;
*' mount '*) *' mount '*)
local opts="-f --foreground -o -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}" local opts="-f --foreground -o -P --prefix -a --glob-archives --sort-by --first --last -e --exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}"
;; ;;
# umount # umount
# no specific options # no specific options
@ -121,15 +121,15 @@ _borg()
*' serve '*) *' serve '*)
local opts="--restrict-to-path --restrict-to-repository --append-only --storage-quota ${common_opts}" local opts="--restrict-to-path --restrict-to-repository --append-only --storage-quota ${common_opts}"
;; ;;
*' config '*)
local opts="-c --cache -d --delete --list ${common_opts}"
;;
# with-lock # with-lock
# no specific options # no specific options
# break-lock # break-lock
# no specific options # no specific options
# benchmark crud # benchmark crud
# no specific options # no specific options
*' config '*)
local opts="-c --cache -d --delete ${common_opts}"
;;
esac esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )

View File

@ -85,6 +85,7 @@ complete -c borg -f -l 'list' -d 'Print verbose list of it
complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'json' -d 'Print verbose stats as json' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'json' -d 'Print verbose stats as json' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'no-cache-sync' -d 'Do not synchronize the cache' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'no-cache-sync' -d 'Do not synchronize the cache' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'stdin-name' -d 'Use NAME in archive for stdin data' -n "__fish_seen_subcommand_from create"
# Exclusion options # Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create" complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from create" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from create"
@ -175,6 +176,7 @@ complete -c borg -f -l 'pattern' -d 'Include/exclude paths ma
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from diff" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from diff"
# borg delete options # borg delete options
complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from delete" complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'cache-only' -d "Delete only the local cache" -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'cache-only' -d "Delete only the local cache" -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'force' -d 'Force deletion of corrupted archives' -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'force' -d 'Force deletion of corrupted archives' -n "__fish_seen_subcommand_from delete"
@ -217,14 +219,20 @@ complete -c borg -f -l 'last' -d 'Only last N archives'
# borg mount options # borg mount options
complete -c borg -f -s f -l 'foreground' -d 'Stay in foreground, do not daemonize' -n "__fish_seen_subcommand_from mount" complete -c borg -f -s f -l 'foreground' -d 'Stay in foreground, do not daemonize' -n "__fish_seen_subcommand_from mount"
# FIXME there are lot more options, but not all are applicable: # FIXME there are lot more options, but not all are applicable:
set -l fuse_options "allow_other allow_root versions allow_damaged_files" set -l fuse_options "allow_other allow_root versions allow_damaged_files uid gid umask"
complete -c borg -f -s o -d 'Fuse mount OPTIONS' -a "$fuse_options" -n "__fish_seen_subcommand_from mount" complete -c borg -f -s o -d 'Fuse mount OPTION' -a "$fuse_options" -n "__fish_seen_subcommand_from mount"
# Archive filters # Archive filters
complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from mount" complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from mount" complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from mount"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from mount"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from mount"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from mount"
# borg umount # borg umount
# no specific options # no specific options
@ -287,6 +295,11 @@ complete -c borg -l 'restrict-to-repository' -d 'Restrict repository acc
complete -c borg -f -l 'append-only' -d 'Only allow appending to repository' -n "__fish_seen_subcommand_from serve" complete -c borg -f -l 'append-only' -d 'Only allow appending to repository' -n "__fish_seen_subcommand_from serve"
complete -c borg -f -l 'storage-quota' -d 'Override storage QUOTA of the repository' -n "__fish_seen_subcommand_from serve" complete -c borg -f -l 'storage-quota' -d 'Override storage QUOTA of the repository' -n "__fish_seen_subcommand_from serve"
# borg config
complete -c borg -f -s c -l 'cache' -d 'Get/set/list values in the repo cache' -n "__fish_seen_subcommand_from config"
complete -c borg -f -s d -l 'delete' -d 'Delete the KEY from the config' -n "__fish_seen_subcommand_from config"
complete -c borg -f -l 'list' -d 'List the configuration of the repo' -n "__fish_seen_subcommand_from config"
# borg with-lock # borg with-lock
# no specific options # no specific options
@ -296,10 +309,6 @@ complete -c borg -f -l 'storage-quota' -d 'Override storage QUOTA o
# borg benchmark # borg benchmark
# no specific options # no specific options
# borg config
complete -c borg -f -s c -l 'cache' -d 'Get/set values in the repo cache' -n "__fish_seen_subcommand_from config"
complete -c borg -f -s d -l 'delete' -d 'Delete the KEY from the config' -n "__fish_seen_subcommand_from config"
# List archives # List archives

View File

@ -86,6 +86,7 @@ _borg() {
--filter'[only display items with the given status characters]:STATUSCHARS'\ --filter'[only display items with the given status characters]:STATUSCHARS'\
--json'[output stats as JSON. Implies --stats.]'\ --json'[output stats as JSON. Implies --stats.]'\
--no-cache-sync'[experimental: do not synchronize the cache. Implies not using the files cache.]'\ --no-cache-sync'[experimental: do not synchronize the cache. Implies not using the files cache.]'\
--stdin-name'[use NAME in archive for stdin data]:NAME'\
{-e,--exclude}'[exclude paths matching PATTERN]:PATTERN'\ {-e,--exclude}'[exclude paths matching PATTERN]:PATTERN'\
--exclude-from'[read exclude patterns from EXCLUDEFILE, one per line]:_files'\ --exclude-from'[read exclude patterns from EXCLUDEFILE, one per line]:_files'\
--pattern'[experimental: include/exclude paths matching PATTERN]:PATTERN'\ --pattern'[experimental: include/exclude paths matching PATTERN]:PATTERN'\
@ -185,6 +186,7 @@ _borg() {
_arguments \ _arguments \
'2:archives:__borg_archive'\ '2:archives:__borg_archive'\
'*:archives:archives'\ '*:archives:archives'\
--dry-run'[do not change the repository]'\
{-s,--stats}'[print statistics for the deleted archive]'\ {-s,--stats}'[print statistics for the deleted archive]'\
--cache-only'[delete only the local cache for the given repository]'\ --cache-only'[delete only the local cache for the given repository]'\
--force'[force deletion of corrupted archives, use --force --force in case --force does not work.]'\ --force'[force deletion of corrupted archives, use --force --force in case --force does not work.]'\
@ -238,6 +240,11 @@ _borg() {
--sort-by'[Comma-separated list of sorting keys]:KEYS'\ --sort-by'[Comma-separated list of sorting keys]:KEYS'\
--first'[consider first N archives after other filters were applied]:N'\ --first'[consider first N archives after other filters were applied]:N'\
--last'[consider last N archives after other filters were applied]:N'\ --last'[consider last N archives after other filters were applied]:N'\
{-e,--exclude}'[exclude paths matching PATTERN]:PATTERN'\
--exclude-from'[read exclude patterns from EXCLUDEFILE, one per line]:_files'\
--pattern'[experimental: include/exclude paths matching PATTERN]:PATTERN'\
--patterns-from'[experimental: read include/exclude patterns from PATTERNFILE, one per line]:_files'\
--strip-components'[Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.]:NUMBER'\
$borg_common_options $borg_common_options
;; ;;
(umount) (umount)
@ -339,7 +346,8 @@ _borg() {
'3:name:NAME'\ '3:name:NAME'\
'4:value:VALUE'\ '4:value:VALUE'\
{-c,--cache}'[get and set values from the repo cache]'\ {-c,--cache}'[get and set values from the repo cache]'\
{-d,--delete}'[delete the key from the config file]'\ {-d,--delete}'[delete the key from the config]'\
--list'[list the configuration of the repo]'\
$borg_common_options $borg_common_options
;; ;;
(with-lock) (with-lock)