Skip to content

Commit fa17e10

Browse files
committed
fix(xfreerdp): try /list:kbd also with dash syntax
This caused failures on recent fedoradev rawhide tests, since it seems to not be built with deprecated options like `/list-kbd` anymore. This introduces an internal utility function to list kbd layouts, which is used in two places. Also stops trying `--kbd-list` whose last trace was removed in 2013: FreeRDP/FreeRDP@9295838
1 parent 90162b0 commit fa17e10

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

completions/xfreerdp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
# xfreerdp completion -*- shell-script -*-
22

3+
_comp_cmd_xfreerdp__kbd_list()
4+
{
5+
local kbd_list
6+
# Trying non deprecated /list:kbd first
7+
kbd_list=$("$1" /list:kbd 2>/dev/null) ||
8+
# Old syntax, deprecated in 2022-10-19
9+
# See https://github.com/FreeRDP/FreeRDP/commit/119b8d4474ab8578101f86226e0d20a53460dd51
10+
kbd_list=$("$1" /kbd-list 2>/dev/null)
11+
_comp_awk '/^0x/ { print $1 }' <<<"$kbd_list"
12+
}
13+
314
_comp_cmd_xfreerdp()
415
{
516
local cur prev words cword comp_args
617
_comp_initialize -n : -- "$@" || return
718

819
case $prev in
920
-k)
10-
_comp_compgen_split -- "$("$1" --kbd-list |
11-
_comp_awk '/^0x/ { print $1 }')"
21+
_comp_compgen_split -- "$(_comp_cmd_xfreerdp__kbd_list "$1")"
1222
return
1323
;;
1424
-a)
@@ -30,12 +40,7 @@ _comp_cmd_xfreerdp()
3040

3141
case $cur in
3242
/kbd:*)
33-
local kbd_list
34-
kbd_list=$("$1" /kbd-list 2>/dev/null) ||
35-
kbd_list=$("$1" /list:kbd 2>/dev/null)
36-
_comp_compgen -c "${cur#/kbd:}" split -- "$(
37-
_comp_awk '/^0x/ { print $1 }' <<<"$kbd_list"
38-
)"
43+
_comp_compgen -c "${cur#/kbd:}" split -- "$(_comp_cmd_xfreerdp__kbd_list "$1")"
3944
return
4045
;;
4146
/bpp:*)

0 commit comments

Comments
 (0)