Skip to content

Commit 0af6d20

Browse files
DogeTheBeastN-R-K
authored andcommitted
fix mutually exclusive zsh completion
also filters out --focussed for simplicity.
1 parent 8acd7a2 commit 0af6d20

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Look for any bugs reported downstream or in our github issues and fix them:
1414
## Shell completion improvements
1515

1616
- Improve the bash completion script. Currently it's quite rudimentary.
17-
- Filter out mutually exclusive options in zsh completion. E.g if `-b` is
17+
- ~~Filter out mutually exclusive options in zsh completion. E.g if `-b` is
1818
already provided then `--border` should no longer be considered a potential
19-
match.
19+
match.~~
2020
- Add some way to install zsh/bash completion scripts. Since the directory where
2121
completion script go into can vary, we want the user to explicitly set the
2222
installation directory. E.g via the configure script

etc/zsh-completion/_scrot

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ for ln in ${(f)list}; do
2222
N) ;; # None
2323
esac
2424

25+
[[ $lopt == "focussed" ]] && continue
26+
2527
if [[ "${sopt}" = [[:alnum:]]* ]]; then
26-
args+=( "-${sopt}${desc}" )
28+
args+=( "(-${sopt} --${lopt})-${sopt}${desc}" )
29+
args+=( "(-${sopt} --${lopt})--${lopt}${desc}" )
30+
else
31+
args+=( "--${lopt}${desc}" )
2732
fi
28-
args+=( "--${lopt}${desc}" )
33+
2934
done
3035
_arguments "${args[@]}"

0 commit comments

Comments
 (0)