Update manpages and auto-completion

This commit is contained in:
Alexander Neumann
2021-08-03 11:45:36 +02:00
parent a92faca10e
commit 94983a1f36
30 changed files with 1376 additions and 1567 deletions

View File

@@ -36,9 +36,103 @@ __restic_contains_word()
return 1
}
__restic_handle_go_custom_completion()
{
__restic_debug "${FUNCNAME[0]}: cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}"
local shellCompDirectiveError=1
local shellCompDirectiveNoSpace=2
local shellCompDirectiveNoFileComp=4
local shellCompDirectiveFilterFileExt=8
local shellCompDirectiveFilterDirs=16
local out requestComp lastParam lastChar comp directive args
# Prepare the command to request completions for the program.
# Calling ${words[0]} instead of directly restic allows to handle aliases
args=("${words[@]:1}")
requestComp="${words[0]} __completeNoDesc ${args[*]}"
lastParam=${words[$((${#words[@]}-1))]}
lastChar=${lastParam:$((${#lastParam}-1)):1}
__restic_debug "${FUNCNAME[0]}: lastParam ${lastParam}, lastChar ${lastChar}"
if [ -z "${cur}" ] && [ "${lastChar}" != "=" ]; then
# If the last parameter is complete (there is a space following it)
# We add an extra empty parameter so we can indicate this to the go method.
__restic_debug "${FUNCNAME[0]}: Adding extra empty parameter"
requestComp="${requestComp} \"\""
fi
__restic_debug "${FUNCNAME[0]}: calling ${requestComp}"
# Use eval to handle any environment variables and such
out=$(eval "${requestComp}" 2>/dev/null)
# Extract the directive integer at the very end of the output following a colon (:)
directive=${out##*:}
# Remove the directive
out=${out%:*}
if [ "${directive}" = "${out}" ]; then
# There is not directive specified
directive=0
fi
__restic_debug "${FUNCNAME[0]}: the completion directive is: ${directive}"
__restic_debug "${FUNCNAME[0]}: the completions are: ${out[*]}"
if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
# Error code. No completion.
__restic_debug "${FUNCNAME[0]}: received error from custom completion go code"
return
else
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
if [[ $(type -t compopt) = "builtin" ]]; then
__restic_debug "${FUNCNAME[0]}: activating no space"
compopt -o nospace
fi
fi
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
if [[ $(type -t compopt) = "builtin" ]]; then
__restic_debug "${FUNCNAME[0]}: activating no file completion"
compopt +o default
fi
fi
fi
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
# File extension filtering
local fullFilter filter filteringCmd
# Do not use quotes around the $out variable or else newline
# characters will be kept.
for filter in ${out[*]}; do
fullFilter+="$filter|"
done
filteringCmd="_filedir $fullFilter"
__restic_debug "File filtering command: $filteringCmd"
$filteringCmd
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
# File completion for directories only
local subDir
# Use printf to strip any trailing newline
subdir=$(printf "%s" "${out[0]}")
if [ -n "$subdir" ]; then
__restic_debug "Listing directories in $subdir"
__restic_handle_subdirs_in_dir_flag "$subdir"
else
__restic_debug "Listing directories in ."
_filedir -d
fi
else
while IFS='' read -r comp; do
COMPREPLY+=("$comp")
done < <(compgen -W "${out[*]}" -- "$cur")
fi
}
__restic_handle_reply()
{
__restic_debug "${FUNCNAME[0]}"
local comp
case $cur in
-*)
if [[ $(type -t compopt) = "builtin" ]]; then
@@ -50,7 +144,9 @@ __restic_handle_reply()
else
allflags=("${flags[*]} ${two_word_flags[*]}")
fi
COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )
while IFS='' read -r comp; do
COMPREPLY+=("$comp")
done < <(compgen -W "${allflags[*]}" -- "$cur")
if [[ $(type -t compopt) = "builtin" ]]; then
[[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
fi
@@ -95,15 +191,22 @@ __restic_handle_reply()
local completions
completions=("${commands[@]}")
if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then
completions=("${must_have_one_noun[@]}")
completions+=("${must_have_one_noun[@]}")
elif [[ -n "${has_completion_function}" ]]; then
# if a go completion function is provided, defer to that function
__restic_handle_go_custom_completion
fi
if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
completions+=("${must_have_one_flag[@]}")
fi
COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )
while IFS='' read -r comp; do
COMPREPLY+=("$comp")
done < <(compgen -W "${completions[*]}" -- "$cur")
if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") )
while IFS='' read -r comp; do
COMPREPLY+=("$comp")
done < <(compgen -W "${noun_aliases[*]}" -- "$cur")
fi
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
@@ -138,7 +241,7 @@ __restic_handle_filename_extension_flag()
__restic_handle_subdirs_in_dir_flag()
{
local dir="$1"
pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1
pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
}
__restic_handle_flag()
@@ -267,42 +370,56 @@ _restic_backup()
flags+=("--exclude=")
two_word_flags+=("--exclude")
two_word_flags+=("-e")
local_nonpersistent_flags+=("--exclude")
local_nonpersistent_flags+=("--exclude=")
local_nonpersistent_flags+=("-e")
flags+=("--exclude-caches")
local_nonpersistent_flags+=("--exclude-caches")
flags+=("--exclude-file=")
two_word_flags+=("--exclude-file")
local_nonpersistent_flags+=("--exclude-file")
local_nonpersistent_flags+=("--exclude-file=")
flags+=("--exclude-if-present=")
two_word_flags+=("--exclude-if-present")
local_nonpersistent_flags+=("--exclude-if-present")
local_nonpersistent_flags+=("--exclude-if-present=")
flags+=("--exclude-larger-than=")
two_word_flags+=("--exclude-larger-than")
local_nonpersistent_flags+=("--exclude-larger-than")
local_nonpersistent_flags+=("--exclude-larger-than=")
flags+=("--files-from=")
two_word_flags+=("--files-from")
local_nonpersistent_flags+=("--files-from")
local_nonpersistent_flags+=("--files-from=")
flags+=("--files-from-raw=")
two_word_flags+=("--files-from-raw")
local_nonpersistent_flags+=("--files-from-raw")
local_nonpersistent_flags+=("--files-from-raw=")
flags+=("--files-from-verbatim=")
two_word_flags+=("--files-from-verbatim")
local_nonpersistent_flags+=("--files-from-verbatim")
local_nonpersistent_flags+=("--files-from-verbatim=")
flags+=("--force")
flags+=("-f")
local_nonpersistent_flags+=("--force")
local_nonpersistent_flags+=("-f")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--iexclude=")
two_word_flags+=("--iexclude")
local_nonpersistent_flags+=("--iexclude")
local_nonpersistent_flags+=("--iexclude=")
flags+=("--iexclude-file=")
two_word_flags+=("--iexclude-file")
local_nonpersistent_flags+=("--iexclude-file")
local_nonpersistent_flags+=("--iexclude-file=")
flags+=("--ignore-ctime")
local_nonpersistent_flags+=("--ignore-ctime")
@@ -311,19 +428,24 @@ _restic_backup()
flags+=("--one-file-system")
flags+=("-x")
local_nonpersistent_flags+=("--one-file-system")
local_nonpersistent_flags+=("-x")
flags+=("--parent=")
two_word_flags+=("--parent")
local_nonpersistent_flags+=("--parent")
local_nonpersistent_flags+=("--parent=")
flags+=("--stdin")
local_nonpersistent_flags+=("--stdin")
flags+=("--stdin-filename=")
two_word_flags+=("--stdin-filename")
local_nonpersistent_flags+=("--stdin-filename")
local_nonpersistent_flags+=("--stdin-filename=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--time=")
two_word_flags+=("--time")
local_nonpersistent_flags+=("--time")
local_nonpersistent_flags+=("--time=")
flags+=("--with-atime")
local_nonpersistent_flags+=("--with-atime")
@@ -385,8 +507,10 @@ _restic_cache()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--max-age=")
two_word_flags+=("--max-age")
local_nonpersistent_flags+=("--max-age")
local_nonpersistent_flags+=("--max-age=")
flags+=("--no-size")
local_nonpersistent_flags+=("--no-size")
@@ -446,6 +570,7 @@ _restic_cat()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
@@ -504,10 +629,12 @@ _restic_check()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--read-data")
local_nonpersistent_flags+=("--read-data")
flags+=("--read-data-subset=")
two_word_flags+=("--read-data-subset")
local_nonpersistent_flags+=("--read-data-subset")
local_nonpersistent_flags+=("--read-data-subset=")
flags+=("--with-cache")
local_nonpersistent_flags+=("--with-cache")
@@ -567,27 +694,40 @@ _restic_copy()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--key-hint2=")
two_word_flags+=("--key-hint2")
local_nonpersistent_flags+=("--key-hint2")
local_nonpersistent_flags+=("--key-hint2=")
flags+=("--password-command2=")
two_word_flags+=("--password-command2")
local_nonpersistent_flags+=("--password-command2")
local_nonpersistent_flags+=("--password-command2=")
flags+=("--password-file2=")
two_word_flags+=("--password-file2")
local_nonpersistent_flags+=("--password-file2")
local_nonpersistent_flags+=("--password-file2=")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--repo2=")
two_word_flags+=("--repo2")
local_nonpersistent_flags+=("--repo2")
local_nonpersistent_flags+=("--repo2=")
flags+=("--repository-file2=")
two_word_flags+=("--repository-file2")
local_nonpersistent_flags+=("--repository-file2")
local_nonpersistent_flags+=("--repository-file2=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -645,6 +785,7 @@ _restic_diff()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--metadata")
local_nonpersistent_flags+=("--metadata")
flags+=("--cacert=")
@@ -703,19 +844,26 @@ _restic_dump()
flags+=("--archive=")
two_word_flags+=("--archive")
two_word_flags+=("-a")
local_nonpersistent_flags+=("--archive")
local_nonpersistent_flags+=("--archive=")
local_nonpersistent_flags+=("-a")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -775,37 +923,50 @@ _restic_find()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--ignore-case")
flags+=("-i")
local_nonpersistent_flags+=("--ignore-case")
local_nonpersistent_flags+=("-i")
flags+=("--long")
flags+=("-l")
local_nonpersistent_flags+=("--long")
local_nonpersistent_flags+=("-l")
flags+=("--newest=")
two_word_flags+=("--newest")
two_word_flags+=("-N")
local_nonpersistent_flags+=("--newest")
local_nonpersistent_flags+=("--newest=")
local_nonpersistent_flags+=("-N")
flags+=("--oldest=")
two_word_flags+=("--oldest")
two_word_flags+=("-O")
local_nonpersistent_flags+=("--oldest")
local_nonpersistent_flags+=("--oldest=")
local_nonpersistent_flags+=("-O")
flags+=("--pack")
local_nonpersistent_flags+=("--pack")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--show-pack-id")
local_nonpersistent_flags+=("--show-pack-id")
flags+=("--snapshot=")
two_word_flags+=("--snapshot")
two_word_flags+=("-s")
local_nonpersistent_flags+=("--snapshot")
local_nonpersistent_flags+=("--snapshot=")
local_nonpersistent_flags+=("-s")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--tree")
local_nonpersistent_flags+=("--tree")
@@ -865,65 +1026,109 @@ _restic_forget()
flags+=("--keep-last=")
two_word_flags+=("--keep-last")
two_word_flags+=("-l")
local_nonpersistent_flags+=("--keep-last")
local_nonpersistent_flags+=("--keep-last=")
local_nonpersistent_flags+=("-l")
flags+=("--keep-hourly=")
two_word_flags+=("--keep-hourly")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--keep-hourly")
local_nonpersistent_flags+=("--keep-hourly=")
local_nonpersistent_flags+=("-H")
flags+=("--keep-daily=")
two_word_flags+=("--keep-daily")
two_word_flags+=("-d")
local_nonpersistent_flags+=("--keep-daily")
local_nonpersistent_flags+=("--keep-daily=")
local_nonpersistent_flags+=("-d")
flags+=("--keep-weekly=")
two_word_flags+=("--keep-weekly")
two_word_flags+=("-w")
local_nonpersistent_flags+=("--keep-weekly")
local_nonpersistent_flags+=("--keep-weekly=")
local_nonpersistent_flags+=("-w")
flags+=("--keep-monthly=")
two_word_flags+=("--keep-monthly")
two_word_flags+=("-m")
local_nonpersistent_flags+=("--keep-monthly")
local_nonpersistent_flags+=("--keep-monthly=")
local_nonpersistent_flags+=("-m")
flags+=("--keep-yearly=")
two_word_flags+=("--keep-yearly")
two_word_flags+=("-y")
local_nonpersistent_flags+=("--keep-yearly")
local_nonpersistent_flags+=("--keep-yearly=")
local_nonpersistent_flags+=("-y")
flags+=("--keep-within=")
two_word_flags+=("--keep-within")
local_nonpersistent_flags+=("--keep-within")
local_nonpersistent_flags+=("--keep-within=")
flags+=("--keep-within-hourly=")
two_word_flags+=("--keep-within-hourly")
local_nonpersistent_flags+=("--keep-within-hourly")
local_nonpersistent_flags+=("--keep-within-hourly=")
flags+=("--keep-within-daily=")
two_word_flags+=("--keep-within-daily")
local_nonpersistent_flags+=("--keep-within-daily")
local_nonpersistent_flags+=("--keep-within-daily=")
flags+=("--keep-within-weekly=")
two_word_flags+=("--keep-within-weekly")
local_nonpersistent_flags+=("--keep-within-weekly")
local_nonpersistent_flags+=("--keep-within-weekly=")
flags+=("--keep-within-monthly=")
two_word_flags+=("--keep-within-monthly")
local_nonpersistent_flags+=("--keep-within-monthly")
local_nonpersistent_flags+=("--keep-within-monthly=")
flags+=("--keep-within-yearly=")
two_word_flags+=("--keep-within-yearly")
local_nonpersistent_flags+=("--keep-within-yearly")
local_nonpersistent_flags+=("--keep-within-yearly=")
flags+=("--keep-tag=")
two_word_flags+=("--keep-tag")
local_nonpersistent_flags+=("--keep-tag")
local_nonpersistent_flags+=("--keep-tag=")
flags+=("--host=")
two_word_flags+=("--host")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--compact")
flags+=("-c")
local_nonpersistent_flags+=("--compact")
local_nonpersistent_flags+=("-c")
flags+=("--group-by=")
two_word_flags+=("--group-by")
two_word_flags+=("-g")
local_nonpersistent_flags+=("--group-by")
local_nonpersistent_flags+=("--group-by=")
local_nonpersistent_flags+=("-g")
flags+=("--dry-run")
flags+=("-n")
local_nonpersistent_flags+=("--dry-run")
local_nonpersistent_flags+=("-n")
flags+=("--prune")
local_nonpersistent_flags+=("--prune")
flags+=("--max-unused=")
two_word_flags+=("--max-unused")
local_nonpersistent_flags+=("--max-unused")
local_nonpersistent_flags+=("--max-unused=")
flags+=("--max-repack-size=")
two_word_flags+=("--max-repack-size")
local_nonpersistent_flags+=("--max-repack-size")
local_nonpersistent_flags+=("--max-repack-size=")
flags+=("--repack-cacheable-only")
local_nonpersistent_flags+=("--repack-cacheable-only")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
@@ -979,15 +1184,23 @@ _restic_generate()
flags+=("--bash-completion=")
two_word_flags+=("--bash-completion")
local_nonpersistent_flags+=("--bash-completion")
local_nonpersistent_flags+=("--bash-completion=")
flags+=("--fish-completion=")
two_word_flags+=("--fish-completion")
local_nonpersistent_flags+=("--fish-completion")
local_nonpersistent_flags+=("--fish-completion=")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--man=")
two_word_flags+=("--man")
local_nonpersistent_flags+=("--man")
local_nonpersistent_flags+=("--man=")
flags+=("--zsh-completion=")
two_word_flags+=("--zsh-completion")
local_nonpersistent_flags+=("--zsh-completion")
local_nonpersistent_flags+=("--zsh-completion=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1028,6 +1241,60 @@ _restic_generate()
noun_aliases=()
}
_restic_help()
{
last_command="restic_help"
command_aliases=()
commands=()
flags=()
two_word_flags=()
local_nonpersistent_flags=()
flags_with_completion=()
flags_completion=()
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
two_word_flags+=("--cache-dir")
flags+=("--cleanup-cache")
flags+=("--json")
flags+=("--key-hint=")
two_word_flags+=("--key-hint")
flags+=("--limit-download=")
two_word_flags+=("--limit-download")
flags+=("--limit-upload=")
two_word_flags+=("--limit-upload")
flags+=("--no-cache")
flags+=("--no-lock")
flags+=("--option=")
two_word_flags+=("--option")
two_word_flags+=("-o")
flags+=("--password-command=")
two_word_flags+=("--password-command")
flags+=("--password-file=")
two_word_flags+=("--password-file")
two_word_flags+=("-p")
flags+=("--quiet")
flags+=("-q")
flags+=("--repo=")
two_word_flags+=("--repo")
two_word_flags+=("-r")
flags+=("--repository-file=")
two_word_flags+=("--repository-file")
flags+=("--tls-client-cert=")
two_word_flags+=("--tls-client-cert")
flags+=("--verbose")
flags+=("-v")
must_have_one_flag=()
must_have_one_noun=()
has_completion_function=1
noun_aliases=()
}
_restic_init()
{
last_command="restic_init"
@@ -1047,18 +1314,27 @@ _restic_init()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--key-hint2=")
two_word_flags+=("--key-hint2")
local_nonpersistent_flags+=("--key-hint2")
local_nonpersistent_flags+=("--key-hint2=")
flags+=("--password-command2=")
two_word_flags+=("--password-command2")
local_nonpersistent_flags+=("--password-command2")
local_nonpersistent_flags+=("--password-command2=")
flags+=("--password-file2=")
two_word_flags+=("--password-file2")
local_nonpersistent_flags+=("--password-file2")
local_nonpersistent_flags+=("--password-file2=")
flags+=("--repo2=")
two_word_flags+=("--repo2")
local_nonpersistent_flags+=("--repo2")
local_nonpersistent_flags+=("--repo2=")
flags+=("--repository-file2=")
two_word_flags+=("--repository-file2")
local_nonpersistent_flags+=("--repository-file2")
local_nonpersistent_flags+=("--repository-file2=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
@@ -1115,14 +1391,18 @@ _restic_key()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
flags+=("--new-password-file=")
two_word_flags+=("--new-password-file")
local_nonpersistent_flags+=("--new-password-file")
local_nonpersistent_flags+=("--new-password-file=")
flags+=("--user=")
two_word_flags+=("--user")
local_nonpersistent_flags+=("--user")
local_nonpersistent_flags+=("--user=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1180,6 +1460,7 @@ _restic_list()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
@@ -1236,20 +1517,26 @@ _restic_ls()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--long")
flags+=("-l")
local_nonpersistent_flags+=("--long")
local_nonpersistent_flags+=("-l")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--recursive")
local_nonpersistent_flags+=("--recursive")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1307,9 +1594,11 @@ _restic_migrate()
flags+=("--force")
flags+=("-f")
local_nonpersistent_flags+=("--force")
local_nonpersistent_flags+=("-f")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
@@ -1368,22 +1657,28 @@ _restic_mount()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--no-default-permissions")
local_nonpersistent_flags+=("--no-default-permissions")
flags+=("--owner-root")
local_nonpersistent_flags+=("--owner-root")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--snapshot-template=")
two_word_flags+=("--snapshot-template")
local_nonpersistent_flags+=("--snapshot-template")
local_nonpersistent_flags+=("--snapshot-template=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1441,14 +1736,18 @@ _restic_prune()
flags+=("--dry-run")
flags+=("-n")
local_nonpersistent_flags+=("--dry-run")
local_nonpersistent_flags+=("-n")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--max-repack-size=")
two_word_flags+=("--max-repack-size")
local_nonpersistent_flags+=("--max-repack-size")
local_nonpersistent_flags+=("--max-repack-size=")
flags+=("--max-unused=")
two_word_flags+=("--max-unused")
local_nonpersistent_flags+=("--max-unused")
local_nonpersistent_flags+=("--max-unused=")
flags+=("--repack-cacheable-only")
local_nonpersistent_flags+=("--repack-cacheable-only")
@@ -1508,6 +1807,7 @@ _restic_rebuild-index()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--read-all-packs")
local_nonpersistent_flags+=("--read-all-packs")
flags+=("--cacert=")
@@ -1566,6 +1866,7 @@ _restic_recover()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
@@ -1622,34 +1923,47 @@ _restic_restore()
flags+=("--exclude=")
two_word_flags+=("--exclude")
two_word_flags+=("-e")
local_nonpersistent_flags+=("--exclude")
local_nonpersistent_flags+=("--exclude=")
local_nonpersistent_flags+=("-e")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--iexclude=")
two_word_flags+=("--iexclude")
local_nonpersistent_flags+=("--iexclude")
local_nonpersistent_flags+=("--iexclude=")
flags+=("--iinclude=")
two_word_flags+=("--iinclude")
local_nonpersistent_flags+=("--iinclude")
local_nonpersistent_flags+=("--iinclude=")
flags+=("--include=")
two_word_flags+=("--include")
two_word_flags+=("-i")
local_nonpersistent_flags+=("--include")
local_nonpersistent_flags+=("--include=")
local_nonpersistent_flags+=("-i")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--target=")
two_word_flags+=("--target")
two_word_flags+=("-t")
local_nonpersistent_flags+=("--target")
local_nonpersistent_flags+=("--target=")
local_nonpersistent_flags+=("-t")
flags+=("--verify")
local_nonpersistent_flags+=("--verify")
flags+=("--cacert=")
@@ -1708,8 +2022,10 @@ _restic_self-update()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--output=")
two_word_flags+=("--output")
local_nonpersistent_flags+=("--output")
local_nonpersistent_flags+=("--output=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1767,24 +2083,34 @@ _restic_snapshots()
flags+=("--compact")
flags+=("-c")
local_nonpersistent_flags+=("--compact")
local_nonpersistent_flags+=("-c")
flags+=("--group-by=")
two_word_flags+=("--group-by")
two_word_flags+=("-g")
local_nonpersistent_flags+=("--group-by")
local_nonpersistent_flags+=("--group-by=")
local_nonpersistent_flags+=("-g")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
flags+=("--last")
local_nonpersistent_flags+=("--last")
local_nonpersistent_flags+=("-H")
flags+=("--latest=")
two_word_flags+=("--latest")
local_nonpersistent_flags+=("--latest")
local_nonpersistent_flags+=("--latest=")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1842,18 +2168,24 @@ _restic_stats()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--mode=")
two_word_flags+=("--mode")
local_nonpersistent_flags+=("--mode")
local_nonpersistent_flags+=("--mode=")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1910,25 +2242,33 @@ _restic_tag()
flags+=("--add=")
two_word_flags+=("--add")
local_nonpersistent_flags+=("--add")
local_nonpersistent_flags+=("--add=")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--host=")
two_word_flags+=("--host")
two_word_flags+=("-H")
local_nonpersistent_flags+=("--host")
local_nonpersistent_flags+=("--host=")
local_nonpersistent_flags+=("-H")
flags+=("--path=")
two_word_flags+=("--path")
local_nonpersistent_flags+=("--path")
local_nonpersistent_flags+=("--path=")
flags+=("--remove=")
two_word_flags+=("--remove")
local_nonpersistent_flags+=("--remove")
local_nonpersistent_flags+=("--remove=")
flags+=("--set=")
two_word_flags+=("--set")
local_nonpersistent_flags+=("--set")
local_nonpersistent_flags+=("--set=")
flags+=("--tag=")
two_word_flags+=("--tag")
local_nonpersistent_flags+=("--tag")
local_nonpersistent_flags+=("--tag=")
flags+=("--cacert=")
two_word_flags+=("--cacert")
@@ -1986,6 +2326,7 @@ _restic_unlock()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--remove-all")
local_nonpersistent_flags+=("--remove-all")
flags+=("--cacert=")
@@ -2044,6 +2385,7 @@ _restic_version()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--cacert=")
two_word_flags+=("--cacert")
flags+=("--cache-dir=")
@@ -2100,6 +2442,7 @@ _restic_root_command()
commands+=("find")
commands+=("forget")
commands+=("generate")
commands+=("help")
commands+=("init")
commands+=("key")
commands+=("list")
@@ -2131,6 +2474,7 @@ _restic_root_command()
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--json")
flags+=("--key-hint=")
two_word_flags+=("--key-hint")
@@ -2167,7 +2511,7 @@ _restic_root_command()
__start_restic()
{
local cur prev words cword
local cur prev words cword split
declare -A flaghash 2>/dev/null || :
declare -A aliashash 2>/dev/null || :
if declare -F _init_completion >/dev/null 2>&1; then
@@ -2183,10 +2527,13 @@ __start_restic()
local flags_with_completion=()
local flags_completion=()
local commands=("restic")
local command_aliases=()
local must_have_one_flag=()
local must_have_one_noun=()
local has_completion_function
local last_command
local nouns=()
local noun_aliases=()
__restic_handle_word
}