]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
bash-nvme-completion.sh: fixed error when sourced twice
authorEvgeny Grin <k2k@narod.ru>
Fri, 17 Jun 2022 12:00:39 +0000 (15:00 +0300)
committerEvgeny Grin <k2k@narod.ru>
Fri, 17 Jun 2022 12:05:20 +0000 (15:05 +0300)
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

index e5d9ff190996dc369166f45bf01c4ab5683cdeb5..7b8a2121dd101797c6114c0a6edabc72c15ee771 100644 (file)
@@ -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