* [PATCH iproute2-next] bash-completion: devlink: Fix dev completion trailing colon
@ 2026-04-26 11:51 Danielle Ratson
2026-04-30 15:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Danielle Ratson @ 2026-04-26 11:51 UTC (permalink / raw)
To: netdev; +Cc: jiri, dsahern, Danielle Ratson
Cited commit extended 'devlink dev show' to print the instance index when
the kernel provides DEVLINK_ATTR_INDEX, printing the device handle followed
by a colon and the index. The completion code was using the raw text output
as a word list, causing the device handle to be offered with a trailing
colon, e.g. "pci/0000:01:00.0:" instead of "pci/0000:01:00.0".
Switch to JSON output and extract device names using jq, consistent
with how port completion already works, to reliably get only the device
handle names regardless of what additional attributes are printed.
Fixes: 36252727bfc6 ("devlink: show devlink instance index in dev output")
Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
bash-completion/devlink | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/bash-completion/devlink b/bash-completion/devlink
index c053d3d0..7ec6a7cb 100644
--- a/bash-completion/devlink
+++ b/bash-completion/devlink
@@ -31,7 +31,8 @@ _devlink_direct_complete()
case $1 in
dev)
- value=$(devlink dev show 2>/dev/null)
+ value=$(devlink -j dev show 2>/dev/null \
+ | jq -r '.dev | keys[]')
;;
selftests_id)
dev=${words[4]}
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH iproute2-next] bash-completion: devlink: Fix dev completion trailing colon
2026-04-26 11:51 [PATCH iproute2-next] bash-completion: devlink: Fix dev completion trailing colon Danielle Ratson
@ 2026-04-30 15:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-04-30 15:40 UTC (permalink / raw)
To: Danielle Ratson; +Cc: netdev, jiri, dsahern
Hello:
This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:
On Sun, 26 Apr 2026 14:51:39 +0300 you wrote:
> Cited commit extended 'devlink dev show' to print the instance index when
> the kernel provides DEVLINK_ATTR_INDEX, printing the device handle followed
> by a colon and the index. The completion code was using the raw text output
> as a word list, causing the device handle to be offered with a trailing
> colon, e.g. "pci/0000:01:00.0:" instead of "pci/0000:01:00.0".
>
> Switch to JSON output and extract device names using jq, consistent
> with how port completion already works, to reliably get only the device
> handle names regardless of what additional attributes are printed.
>
> [...]
Here is the summary with links:
- [iproute2-next] bash-completion: devlink: Fix dev completion trailing colon
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=03b33c7550e9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-30 15:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-26 11:51 [PATCH iproute2-next] bash-completion: devlink: Fix dev completion trailing colon Danielle Ratson
2026-04-30 15:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox