Re: [PATCH] Update bash completions to prevent unbound variable errors.

From
Ted Pavlic <hidden>
Date
2016-06-15 22:45:56
Reply to
Boyd Stephen Smith Jr., 2016-06-15
quoted
         if [ -z "${1-}" ]
That looks ugly to me.  Any reason we shouldn't just "set +u" at the top of
the script?
As already discussed, because the script must be sourced, then the "set +u" has global scope.

I suppose that the option could be tested and then reset as appropriate at the end of the script.

(note: for some reason Mercurial's bash completion script does not have this problem; they use $1 directly without bash complaining)

-- 
Ted Pavlic [off-list ref]

  Please visit my ALS association page:
        http://web.alsa.org/goto/tedpavlic
  My family appreciates your support in the fight to defeat ALS.
Thread (14 messages) 14 messages, 4 authors, last reply 2016-06-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help