30 lines
875 B
Diff
30 lines
875 B
Diff
|
From 2034de6157cc0d3e60489cdc16c7a5651f38783c Mon Sep 17 00:00:00 2001
|
||
|
From: David Tardon <dtardon@redhat.com>
|
||
|
Date: Wed, 12 Jun 2024 14:35:34 +0200
|
||
|
Subject: [PATCH] shell-completion: only offer devices for completion
|
||
|
|
||
|
This skips directories and other stuff like /dev/core, /dev/initctl or
|
||
|
/dev/log.
|
||
|
|
||
|
(cherry picked from commit bde35f4a91663ebb854330f582baeef0f9adcbfb)
|
||
|
---
|
||
|
shell-completion/bash/udevadm | 5 +----
|
||
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm
|
||
|
index 05f921cf49..3842d722e7 100644
|
||
|
--- a/shell-completion/bash/udevadm
|
||
|
+++ b/shell-completion/bash/udevadm
|
||
|
@@ -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() {
|