diff options
-rw-r--r-- | completions/xrandr | 8 | ||||
-rw-r--r-- | test/lib/completions/xrandr.exp | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/completions/xrandr b/completions/xrandr index 757b6589..643b11f5 100644 --- a/completions/xrandr +++ b/completions/xrandr @@ -19,9 +19,11 @@ _xrandr() break fi done - local modes=$( xrandr | sed -e "1,/$output/ d" \ - -e "/connected/,$ d" | awk '{print $1}' ) - COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) + if [[ $output ]]; then + local modes=$( xrandr | sed -e "1,/$output/ d" \ + -e "/connected/,$ d" | awk '{print $1}' ) + COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) + fi return ;; -o|--orientation) diff --git a/test/lib/completions/xrandr.exp b/test/lib/completions/xrandr.exp index 14beb762..e76a5665 100644 --- a/test/lib/completions/xrandr.exp +++ b/test/lib/completions/xrandr.exp @@ -12,8 +12,9 @@ setup assert_complete_any "xrandr " +sync_after_int - +assert_no_complete "xrandr --mode " sync_after_int |