Forráskód Böngészése

Shell completions reflect latest changes

SanskritFritz 7 éve
szülő
commit
46a5db7de8

+ 6 - 6
scripts/shell_completions/bash/borg

@@ -71,7 +71,7 @@ _borg()
                 local opts="-e --encryption --append-only --storage-quota ${common_opts}"
                 ;;
             *' 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 '*)
                 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}"
                 ;;
             *' 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 '*)
                 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}"
                 ;;
             *' 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
             #   no specific options
@@ -121,15 +121,15 @@ _borg()
             *' serve '*)
                 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
             #   no specific options
             # break-lock
             #   no specific options
             # benchmark crud
             #   no specific options
-            *' config '*)
-                local opts="-c --cache -d --delete ${common_opts}"
-                ;;
         esac
 
         COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )

+ 15 - 6
scripts/shell_completions/fish/borg.fish

@@ -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 '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 'stdin-name'            -d 'Use NAME in archive for stdin data'         -n "__fish_seen_subcommand_from create"
 # Exclusion options
 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"
@@ -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"
 
 # 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      -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"
@@ -217,14 +219,20 @@ complete -c borg -f      -l 'last'                  -d 'Only last N archives'
 # borg mount options
 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:
-set -l fuse_options "allow_other allow_root versions allow_damaged_files"
-complete -c borg -f -s o                            -d 'Fuse mount OPTIONS' -a "$fuse_options"      -n "__fish_seen_subcommand_from mount"
+set -l fuse_options "allow_other allow_root versions allow_damaged_files uid gid umask"
+complete -c borg -f -s o                            -d 'Fuse mount OPTION' -a "$fuse_options"       -n "__fish_seen_subcommand_from mount"
 # 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 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 '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"
+# 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
 # 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 '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
 # no specific options
 
@@ -296,10 +309,6 @@ complete -c borg -f      -l 'storage-quota'         -d 'Override storage QUOTA o
 # borg benchmark
 # 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
 

+ 9 - 1
scripts/shell_completions/zsh/_borg

@@ -86,6 +86,7 @@ _borg() {
                 --filter'[only display items with the given status characters]:STATUSCHARS'\
                 --json'[output stats as JSON. Implies --stats.]'\
                 --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'\
                 --exclude-from'[read exclude patterns from EXCLUDEFILE, one per line]:_files'\
                 --pattern'[experimental: include/exclude paths matching PATTERN]:PATTERN'\
@@ -185,6 +186,7 @@ _borg() {
             _arguments \
                 '2:archives:__borg_archive'\
                 '*:archives:archives'\
+                --dry-run'[do not change the repository]'\
                 {-s,--stats}'[print statistics for the deleted archive]'\
                 --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.]'\
@@ -238,6 +240,11 @@ _borg() {
                 --sort-by'[Comma-separated list of sorting keys]:KEYS'\
                 --first'[consider first 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
             ;;
         (umount)
@@ -339,7 +346,8 @@ _borg() {
                 '3:name:NAME'\
                 '4:value:VALUE'\
                 {-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
             ;;
         (with-lock)