Various fixes mostly relating to the User Settings stuff:
- Added new utility function to Arg, GetQuotedCommandString, which re-assembles
the args into a string, replacing quotes that were originally there.
- Modified user settings stuff to always show individual elements when printing out
arrays and dictionaries.
- Added more extensive help to 'settings set', explaining more about dictionaries
and arrays (including current dictionary syntax).
- Fixed bug in user settings where quotes were being stripped and lost, so that
sometimes array or dictionary elements that ought to have been a single element
were being split up.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121438 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/Args.cpp b/source/Interpreter/Args.cpp
index b0e448e..e5264e5 100644
--- a/source/Interpreter/Args.cpp
+++ b/source/Interpreter/Args.cpp
@@ -93,6 +93,28 @@
return argc > 0;
}
+bool
+Args::GetQuotedCommandString (std::string &command)
+{
+ command.clear ();
+ int argc = GetArgumentCount ();
+ for (int i = 0; i < argc; ++i)
+ {
+ if (i > 0)
+ command += ' ';
+ char quote_char = m_args_quote_char[i];
+ if (quote_char != '\0')
+ {
+ command += quote_char;
+ command += m_argv[i];
+ command += quote_char;
+ }
+ else
+ command += m_argv[i];
+ }
+ return argc > 0;
+}
+
void
Args::SetCommandString (const char *command, size_t len)
{