mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-31 22:36:31 -04:00
Complete 'help' if the entry directory is empty or does not exist
Former-commit-id: 1167f06b14ce50baa0c96e67a835247c6579aaa9 Former-commit-id: ea6be360d50c16579253d1e2d0b1825c5a1f1a4a
This commit is contained in:
@@ -9,6 +9,7 @@ _path_gen() {
|
|||||||
for path in "${full_paths[@]}"; do
|
for path in "${full_paths[@]}"; do
|
||||||
trimmed_paths+=("${path:${#sshyp_path}:-4}")
|
trimmed_paths+=("${path:${#sshyp_path}:-4}")
|
||||||
done
|
done
|
||||||
|
if [ "${trimmed_paths[0]}" == '/**/*' ]; then trimmed_paths[0]=help; fi
|
||||||
} &&
|
} &&
|
||||||
|
|
||||||
_sshyp_completions() {
|
_sshyp_completions() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ full_paths=("$sshyp_path"/**/*.gpg)
|
|||||||
for scan_path in "${full_paths[@]}"; do
|
for scan_path in "${full_paths[@]}"; do
|
||||||
trimmed_paths+=("${${scan_path#$sshyp_path}%????}")
|
trimmed_paths+=("${${scan_path#$sshyp_path}%????}")
|
||||||
done
|
done
|
||||||
|
[[ -v trimmed_paths ]] || trimmed_paths=(help)
|
||||||
|
|
||||||
case ${words[-2]} in
|
case ${words[-2]} in
|
||||||
sshyp )
|
sshyp )
|
||||||
|
|||||||
Reference in New Issue
Block a user