nvme-cli/SOURCES/0003-bash-nvme-completion.s...

29 lines
943 B
Diff

From eac9f9b70081ff2df2e2ea11efb8fc6ec3754f64 Mon Sep 17 00:00:00 2001
From: Evgeny Grin <k2k@narod.ru>
Date: Fri, 17 Jun 2022 15:00:39 +0300
Subject: [PATCH] bash-nvme-completion.sh: fixed error when sourced twice
One-line "readonly" with assignment produce error if completion file
is sourced for the second time (/etc/profile reload, su etc.)
---
completions/bash-nvme-completion.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh
index e5d9ff19..7b8a2121 100644
--- a/completions/bash-nvme-completion.sh
+++ b/completions/bash-nvme-completion.sh
@@ -5,7 +5,8 @@
# Kelly Kaoudis kelly.n.kaoudis at intel.com, Aug. 2015
# Constant to indicate command has no options
-readonly NO_OPTS=""
+NO_OPTS=""
+readonly NO_OPTS
# Associative array of plugins and associated subcommands
# Order here is same as PLUGIN_OBJS in Makefile
--
2.31.1