]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: do not print eject --cdspeed error messages
authorSami Kerola <kerolasa@iki.fi>
Thu, 5 Apr 2018 19:56:54 +0000 (20:56 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 6 Apr 2018 11:03:38 +0000 (13:03 +0200)
Bash completion is proposing --cdspeed option argument from 'eject
--listspeed /dev/cdrom' output.  Nowadays it is common not to have such
device, and this results to an unwanted error message to stderr merely
messing up command line.  Lets stop that.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/eject

index 123829ea25bc74c141c765842a6c09e41c23a868..327ef1b713aa443338b11f0cac0517b063ec5621 100644 (file)
@@ -15,7 +15,7 @@ _eject_module()
                        return 0
                        ;;
                '-x'|'--cdspeed')
-                       COMPREPLY=( $(compgen -W "$($1 -X)" -- $cur) )
+                       COMPREPLY=( $(compgen -W "$(eject --listspeed 2>/dev/null)" -- $cur) )
                        return 0
                        ;;
                '-h'|'--help'|'-V'|'--version')