- Fix alias-building & resolving to properly handle optional arguments for command options.
- Add logging for command resolution ('log enable lldb commands')
- Fix alias resolution to properly handle commands that take raw input (resolve the alias, but
don't muck up the raw arguments).
Net result: Among other things, 'expr' command can now take strings with escaped characters and
not have the command handling & alias resolution code muck up the escaped characters. E.g.
'expr printf ("\n\n\tHello there!")' should now work properly.
Not working yet: Creating aliases with raw input for commands that take raw input. Working on that.
e.g. 'command alias print_hi expr printf ("\n\tHi!")' does not work yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121171 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectCommands.cpp b/source/Commands/CommandObjectCommands.cpp
index ea4ae03..0ca50b0 100644
--- a/source/Commands/CommandObjectCommands.cpp
+++ b/source/Commands/CommandObjectCommands.cpp
@@ -336,9 +336,11 @@
argc = args.GetArgumentCount();
for (size_t i = 0; i < argc; ++i)
- if (strcmp (args.GetArgumentAtIndex (i), "") != 0)
- option_arg_vector->push_back (OptionArgPair ("<argument>",
- std::string (args.GetArgumentAtIndex (i))));
+ if (strcmp (args.GetArgumentAtIndex (i), "") != 0)
+ option_arg_vector->push_back
+ (OptionArgPair ("<argument>",
+ OptionArgValue (-1,
+ std::string (args.GetArgumentAtIndex (i)))));
}
// Create the alias.