arguments: fix space handling issue
this is an initial attempt at a fix for the below described issue. i've tested it a little and it seems to work, but it could do with a closer look. i'm very tired at the moment from lack of sleep. i'll return to this tomorrow and try to check things out more thoroughly, this is just a first stab at the solution, and i wanted to show where i've got to so far.
i looked at the format of the string returned by getopt
, which itself gets passed to eval set --
, to try to gain an understanding of how to communicate things properly to eval set --
with args embedded within a single string. it seems there is a format and that format is simply to quote each argument with single quotes, and space separate them.
i.e. "'--archives-areas' 'main contrib non-free'"
this fix constructs the string accordingly and appears to fix the bug.
the one particular area in which the fix is lacking is in handling escaping for arguments that include characters that may need escaping, such as an "'".
an alternative to the approach i'm taking here could possibly be to see if we can run the arguments through getopt
again, relying upon that to do the necessary work to format the string correctly.
from the commit log:
it was noted that when using an option value containing spaces, for example `lb config --archives-areas "main contrib non-free" that this was mishandled in the changes implemented in commit 6b7c8ed4, resulting in "main" being the only portion of the value used.