forked from OSchip/llvm-project
Now that "settings set" will strip leading and trailing spaces, we need a way to be able to specify string values that contain spaces. So now settings setting <property> <value>" can have a <value> that is quoted:
settings set prompt "(lldb2) " llvm-svn: 176545
This commit is contained in:
parent
ff2a3ad81b
commit
21c895e3d5
|
@ -55,6 +55,28 @@ OptionValueString::SetValueFromCString (const char *value_cstr,
|
|||
VarSetOperationType op)
|
||||
{
|
||||
Error error;
|
||||
|
||||
std::string value_str_no_quotes;
|
||||
if (value_cstr)
|
||||
{
|
||||
switch (value_cstr[0])
|
||||
{
|
||||
case '"':
|
||||
case '\'':
|
||||
{
|
||||
size_t len = strlen(value_cstr);
|
||||
if (len <= 1 || value_cstr[len-1] != value_cstr[0])
|
||||
{
|
||||
error.SetErrorString("mismatched quotes");
|
||||
return error;
|
||||
}
|
||||
value_str_no_quotes.assign (value_cstr + 1, len - 2);
|
||||
value_cstr = value_str_no_quotes.c_str();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case eVarSetOperationInvalid:
|
||||
|
|
|
@ -62,7 +62,7 @@ class AbbreviationsTestCase(TestBase):
|
|||
self.expect("lo li",
|
||||
startstr = "Logging categories for ")
|
||||
|
||||
self.runCmd("se se prompt Sycamore> ")
|
||||
self.runCmd("se se prompt 'Sycamore> '")
|
||||
self.expect("se sh prompt",
|
||||
startstr = 'prompt (string) = "Sycamore> "')
|
||||
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
settings set prompt [with-three-trailing-spaces]
|
||||
|
||||
settings set prompt "[with-three-trailing-spaces] "
|
Loading…
Reference in New Issue