<div dir="ltr"><div dir="ltr"><div dir="ltr"></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I'm surprised that shellcheck didn't complain about lines 26, 58, 73,<br>
96, 98, 141 (of the patch, don't know its correspondences with the code).</blockquote><div><br></div><div>Most of those are inside `[[` tests, so they don't require quoting (word splitting doesn't happen inside `[[`). The other case is a for loop, which shellcheck doesn't warn about (in fact if you quote it, it will give you <a href="https://github.com/koalaman/shellcheck/wiki/SC2066">warning SC2066</a>). It assumes you will rely on word splittin<span class="gmail_default" style="font-size:small">g</span> to get a list of args.<br></div><div><br></div><div class="gmail_default" style="font-size:small">Chiraag, I'm a bit confused why the switch to using array notation for `$PASSWORD_STORE_GPG_OPTS`. That's not going to be an array, but just a string that can be set in the environment. Also, the quoting would pass the users opts as one string, instead of separate strings to `gpg`. Consider this example:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="courier new, monospace">$ var="-n foo"</font></div><div class="gmail_default"><span style="font-family:"courier new",monospace">$ echo $var</span></div><div class="gmail_default"><font face="courier new, monospace">foo$ echo "$var"</font></div><div class="gmail_default"><font face="courier new, monospace">-n foo</font></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">We either want to not quote, or use something like `mapfile` or `read -a` to put the opts into an array. I hesitate to use `mapfile` since that wasn't around in bash 3, which is what ships in macOS these days (many are using bash 5 now!). But `read -a` is a good alternative.</div></div></div></div>