]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell-completion: only offer devices for completion
authorDavid Tardon <dtardon@redhat.com>
Wed, 12 Jun 2024 12:35:34 +0000 (14:35 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Jun 2024 15:03:25 +0000 (00:03 +0900)
This skips directories and other stuff like /dev/core, /dev/initctl or
/dev/log.

shell-completion/bash/udevadm

index 05f921cf49dc8a0c53e5a6e25eae201e0e673da5..3842d722e753a8b7f64b3519ddb6d499caade8e2 100644 (file)
@@ -32,10 +32,7 @@ __get_all_sysdevs() {
 }
 
 __get_all_device_nodes() {
-    local i
-    for i in /dev/* /dev/*/* /dev/*/*/*; do
-        echo $i
-    done
+    find /dev -xtype b -o -xtype c
 }
 
 __get_all_device_units() {