Skip to content

Commit 48e12d3

Browse files
committed
feat(xev): new completion
1 parent 196a8f6 commit 48e12d3

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

completions/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ bashcomp_DATA = 2to3 \
454454
wvdial \
455455
xdg-mime \
456456
xdg-settings \
457+
xev \
457458
xfreerdp \
458459
xgamma \
459460
xhost \

completions/xev

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# xev(1) completion -*- shell-script -*-
2+
3+
_comp_cmd_xev()
4+
{
5+
local cur prev words cword
6+
_init_completion || return
7+
8+
case $prev in
9+
-display | -geometry | -bw | -id | -name)
10+
return
11+
;;
12+
-bs)
13+
COMPREPLY=($(compgen -W 'NotUseful WhenMapped Always' -- "$cur"))
14+
return
15+
;;
16+
-event)
17+
COMPREPLY=($(
18+
compgen -W '
19+
keyboard mouse expose visibility structure substructure
20+
focus property colormap owner_grab_button randr button
21+
' -- "$cur"
22+
))
23+
return
24+
;;
25+
esac
26+
27+
if [[ $cur == -* ]]; then
28+
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
29+
return
30+
fi
31+
} &&
32+
complete -F _comp_cmd_xev xev
33+
34+
# ex: filetype=sh

test/t/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ EXTRA_DIST = \
671671
test_wvdial.py \
672672
test_xdg_mime.py \
673673
test_xdg_settings.py \
674+
test_xev.py \
674675
test_xfreerdp.py \
675676
test_xgamma.py \
676677
test_xhost.py \

test/t/test_xev.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pytest
2+
3+
4+
class TestXev:
5+
@pytest.mark.complete("xev ")
6+
def test_basic(self, completion):
7+
assert not completion
8+
9+
@pytest.mark.complete("xev -", require_cmd=True)
10+
def test_options(self, completion):
11+
assert completion

test/test-cmd-list.txt

+1
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ wsimport
420420
wtf
421421
wvdial
422422
xdg-settings
423+
xev
423424
xfreerdp
424425
xgamma
425426
xmllint

0 commit comments

Comments
 (0)