Added completition.
Completitions for httm, nicotine, bowie and ounce.
This commit is contained in:
parent
4c30d7374a
commit
aaa56f3f1c
131
020_zfs_httm.sh
131
020_zfs_httm.sh
|
|
@ -24,6 +24,7 @@ COMPONENTS=()
|
|||
ARCHITECTURES=(amd64)
|
||||
KEY_HOME=/usr/share/keyrings
|
||||
KEY=${KEY_HOME}/"${USER}.gpg"
|
||||
ZSH_FUNCTIONS_HOME="/usr/local/share/zsh/site-functions"
|
||||
packages=(httm two-percent fzf)
|
||||
|
||||
sudo mkdir -p ${KEY_HOME}
|
||||
|
|
@ -182,5 +183,135 @@ EOF
|
|||
}
|
||||
# conf_print_ounce_aliases | tee ${DEST}/.zsh_aliases.d/010_httm-aliases >/dev/null
|
||||
|
||||
conf_print_httm_completions() {
|
||||
cat <<EOF
|
||||
#compdef httm
|
||||
|
||||
_httm() {
|
||||
_arguments \
|
||||
'(-h --help)'{-h,--help}'[Print help]' \
|
||||
'(-V --version)'{-V,--version}'[Print version]' \
|
||||
'(-b --browse)'{-b,--browse}'[Interactive browsing mode (aliases: --interactive)]' \
|
||||
'(-s --select)'{-s+,--select=}'[Interactive select mode (values: path, contents, preview)]::select:(path contents preview)' \
|
||||
'(-c --copy)'{-c+,--copy=}'[Copy snapshot file (values: copy, copy-and-preserve, preserve)]::copy:(copy copy-and-preserve preserve)' \
|
||||
'(-r --restore)'{-r+,--restore=}'[Restore snapshot file (values: overwrite, yolo, guard)]::restore:(overwrite yolo guard)' \
|
||||
'(-d --deleted)'{-d+,--deleted=}'[Include deleted files (values: all, single, only, one)]::deleted:(all single only one)' \
|
||||
'(-R --recursive)'{-R,--recursive}'[Recurse into directories in interactive/deleted modes]' \
|
||||
'(-a --alt-replicated)'{-a,--alt-replicated}'[Include locally replicated datasets]' \
|
||||
'(-p --preview)'{-p+,--preview=}'[Specify preview command]' \
|
||||
'(--dedup-by)'--dedup-by='[Set deduplication mode (aliases: --unique, --uniqueness)]::dedup-by:(disable all no-filter metadata contents suspect)' \
|
||||
'(-e --exact)'{-e,--exact}'[Use exact matching in interactive modes]' \
|
||||
'(-S --snap)'{-S+,--snap=}'[Snapshot immediate mount (default suffix: httmSnapFileMount)]' \
|
||||
'(--list-snaps)'--list-snaps='[List snapshot names (filter patterns or limits)]' \
|
||||
'(--roll-forward)'--roll-forward='[Perform non-destructive roll-forward from snapshot]' \
|
||||
'(--prune)'--prune'[Prune snapshots containing given files]' \
|
||||
'(-m --file-mount)'{-m+,--file-mount=}'[Show file mount info (values: source, target, mount, directory, device, dataset, relative-path, relative)]::mount:(source target mount directory device dataset relative-path relative relpath)' \
|
||||
'(-l --last-snap)'{-l+,--last-snap=}'[Print last unique snapshot version (aliases: --last, --latest)]::last:(any ditto no-ditto no-ditto-exclusive no-ditto-inclusive none without)' \
|
||||
'(-n --raw)'{-n,--raw}'[Show snapshot locations only, newline-delimited]' \
|
||||
'(-0 --zero)'{-0,--zero}'[Show snapshot locations only, null-delimited]' \
|
||||
'(--csv)'--csv'[Output in CSV format]' \
|
||||
'(--not-so-pretty)'--not-so-pretty'[Output tab-delimited without borders (aliases: --tabs, --plain-jane, --not-pretty)]' \
|
||||
'(--json)'--json'[Output in JSON format]' \
|
||||
'(--omit-ditto)'--omit-ditto'[Omit identical live snapshot versions]' \
|
||||
'(--no-filter)'--no-filter'[Disable filtering of unsupported datasets]' \
|
||||
'(--no-hidden)'--no-hidden'[Hide hidden files in recursive/interactive modes]' \
|
||||
'(--one-filesystem)'--one-filesystem'[Limit search to same filesystem]' \
|
||||
'(--no-traverse)'--no-traverse'[Disable symlink traversal in recursive mode]' \
|
||||
'(--no-live)'--no-live'[Only display snapshot info (aliases: --dead, --disco)]' \
|
||||
'(--no-snap)'--no-snap'[Only display pseudo-live versions (aliases: --undead, --zombie)]' \
|
||||
'(--alt-store)'--alt-store='[Prioritize alternative backups (values: restic, timemachine)]::store:(restic timemachine)' \
|
||||
'(--map-aliases)'--map-aliases='[Map local to remote directory aliases (aliases: --aliases)]' \
|
||||
'(--num-versions)'--num-versions='[Display number of unique versions (all, graph, single*, multiple)]::num:(all graph single single-no-snap single-with-snap multiple)' \
|
||||
'(--utc)'--utc'[Use UTC timestamps]' \
|
||||
'(--no-clones)'--no-clones'[Disable reflink cloning]' \
|
||||
'(-L --lazy)'{-L,--lazy}'[Lazily resolve snapshot locations]' \
|
||||
'(--debug)'--debug'[Show debugging info]' \
|
||||
'(--install-zsh-hot-keys)'--install-zsh-hot-keys'[Install zsh hot keys]' \
|
||||
'*:input files:_files'
|
||||
}
|
||||
EOF
|
||||
}
|
||||
conf_print_httm_completions | sudo tee "${ZSH_FUNCTIONS_HOME}/_httm" >/dev/null
|
||||
|
||||
conf_print_nicotine_completions() {
|
||||
cat <<EOF
|
||||
#compdef nicotine
|
||||
|
||||
_nicotine() {
|
||||
_arguments \
|
||||
'--output-dir[Select output directory]:directory:_files -/' \
|
||||
'--no-archive[Disable archive creation]' \
|
||||
'--single-repo[Use single git repository for all files]' \
|
||||
'--debug[Show git and tar command output]' \
|
||||
'(--help -h)'{-h,--help}'[Display this dialog]' \
|
||||
'(-V --version)'{-V,--version}'[Display script version]' \
|
||||
'*:files:_files'
|
||||
}
|
||||
EOF
|
||||
}
|
||||
conf_print_nicotine_completions | sudo tee "${ZSH_FUNCTIONS_HOME}/_nicotine" >/dev/null
|
||||
|
||||
conf_print_bowie_completions() {
|
||||
cat <<EOF
|
||||
#compdef bowie
|
||||
|
||||
_bowie() {
|
||||
_arguments \
|
||||
'--last[Show diff between last snapshot version and live file]' \
|
||||
'--all[Show diffs between all consecutive snapshot versions]' \
|
||||
'--select[Interactive httm session to select snapshot diff]' \
|
||||
'--direct[Use bowie formatting for differences]' \
|
||||
'--command[Pipe differences through custom command]' \
|
||||
'(--help -h)'{-h,--help}'[Display this dialog]' \
|
||||
'(-V --version)'{-V,--version}'[Display script version]' \
|
||||
'*:files:_files'
|
||||
}
|
||||
EOF
|
||||
}
|
||||
conf_print_bowie_completions | sudo tee "${ZSH_FUNCTIONS_HOME}/_bowie" >/dev/null
|
||||
|
||||
conf_print_ounce_completions() {
|
||||
cat <<EOF
|
||||
#compdef ounce
|
||||
|
||||
_ounce() {
|
||||
_arguments \
|
||||
'--background[Run snapshot check in background]' \
|
||||
'--trace[Trace file operations with strace/eBPF]' \
|
||||
'--direct[Execute directly on paths]' \
|
||||
'--give-priv[Grant ZFS snapshot privileges to user]' \
|
||||
'--suffix=[Custom snapshot suffix]:suffix:' \
|
||||
'--utc[Use UTC timestamps]' \
|
||||
'(--help -h)'{-h,--help}'[Display this dialog]' \
|
||||
'(-V --version)'{-V,--version}'[Display script version]' \
|
||||
'*:paths:_files' \
|
||||
&& return 0
|
||||
}
|
||||
EOF
|
||||
}
|
||||
conf_print_ounce_completions | sudo tee "${ZSH_FUNCTIONS_HOME}/_ounce" >/dev/null
|
||||
|
||||
conf_print_equine_completions() {
|
||||
cat <<EOF
|
||||
#compdef equine
|
||||
|
||||
_equine() {
|
||||
_arguments \
|
||||
'--mount-local[Mount local Time Machine snapshots]' \
|
||||
'--unmount-local[Unmount local Time Machine snapshots]' \
|
||||
'--mount-remote[Mount remote Time Machine snapshots]' \
|
||||
'--unmount-remote[Unmount remote Time Machine snapshots]' \
|
||||
'(--help -h)'{-h,--help}'[Display this dialog]' \
|
||||
'(-V --version)'{-V,--version}'[Display script version]'
|
||||
}
|
||||
EOF
|
||||
}
|
||||
conf_print_equine_completions | sudo tee "${ZSH_FUNCTIONS_HOME}/_equine" >/dev/null
|
||||
|
||||
Rebuild the completion cache:
|
||||
#
|
||||
|
||||
autoload -Uz compinit && compinit
|
||||
|
||||
# request ZFS snapshot privileges
|
||||
ounce --give-priv
|
||||
|
|
|
|||
Loading…
Reference in New Issue