6 declare -a available_restic_mount_opts
=($
(restic mount
--help |
grep -Eio "[-]-[a-z0-9-]+"))
7 declare -a restic_mount_args
=()
25 option_key
=${option%%=*}
27 for restic_opt
in "${available_restic_mount_opts[@]}"
33 if [ "--$option_key" = "$restic_opt" ]
35 if [[ $option =~
=(.
+) ]]
37 option_value
=${BASH_REMATCH[1]}
38 if [ "${option_value:0:2}" = '~/' ]
40 option_value
=$HOME/${option_value:2}
41 option
="$option_key=$option_value"
45 restic_mount_args
+=("--$option")
51 if [ $is_restic_opt = 0 ]
53 fuse_opts
=$fuse_opts${fuse_opts:+,}$option
62 echo "Unknown option: $1" >&2
71 exec setsid restic mount
"${restic_mount_args[@]}" --repo="$mntname" ${fuse_opts:+-o "$fuse_opts"} "$mntpoint" &