Added new options to "target create" and "target modules add".

For "target create" you can now specify "--no-dependents" to not track down and add all dependent shared libraries. This can be handy when doing manual symbolication. Also added the "--symfile" or "-s" for short so you can specify a module and a stand alone debug info file:

(lldb) target create --symfile /tmp/a.dSYM /usr/bin/a

Added the "--symfile" option to the "target modules add" for the same reason. These all help with manualy symbolication and expose functionality that was previously only available through the public API layer.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169023 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/OptionGroupFile.cpp b/source/Interpreter/OptionGroupFile.cpp
index 532d78f..4749087 100644
--- a/source/Interpreter/OptionGroupFile.cpp
+++ b/source/Interpreter/OptionGroupFile.cpp
@@ -43,8 +43,8 @@
 
 Error
 OptionGroupFile::SetOptionValue (CommandInterpreter &interpreter,
-                                         uint32_t option_idx,
-                                         const char *option_arg)
+                                 uint32_t option_idx,
+                                 const char *option_arg)
 {
     Error error (m_file.SetValueFromCString (option_arg));
     return error;
diff --git a/source/Interpreter/OptionGroupPlatform.cpp b/source/Interpreter/OptionGroupPlatform.cpp
index b3c419c..358dc01 100644
--- a/source/Interpreter/OptionGroupPlatform.cpp
+++ b/source/Interpreter/OptionGroupPlatform.cpp
@@ -84,7 +84,7 @@
     { LLDB_OPT_SET_ALL, false, "platform", 'p', required_argument, NULL, 0, eArgTypePlatform, "Specify name of the platform to use for this target, creating the platform if necessary."},
     { LLDB_OPT_SET_ALL, false, "version" , 'v', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." },
     { LLDB_OPT_SET_ALL, false, "build"   , 'b', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK build number." },
-    { LLDB_OPT_SET_ALL, false, "sysroot" , 's', required_argument, NULL, 0, eArgTypeFilename, "Specify the SDK root directory that contains a root of all remote system files." }
+    { LLDB_OPT_SET_ALL, false, "sysroot" , 'S', required_argument, NULL, 0, eArgTypeFilename, "Specify the SDK root directory that contains a root of all remote system files." }
 };
 
 const OptionDefinition*
diff --git a/source/Interpreter/Options.cpp b/source/Interpreter/Options.cpp
index 484e778..4a04a46 100644
--- a/source/Interpreter/Options.cpp
+++ b/source/Interpreter/Options.cpp
@@ -274,17 +274,21 @@
         m_getopt_table.resize(num_options + 1);
         for (i = 0, j = 0; i < num_options; ++i)
         {
-            char short_opt = opt_defs[i].short_option;
+            const char short_opt = opt_defs[i].short_option;
 
             if (option_seen.test(short_opt) == false)
             {
                 m_getopt_table[j].name    = opt_defs[i].long_option;
                 m_getopt_table[j].has_arg = opt_defs[i].option_has_arg;
                 m_getopt_table[j].flag    = NULL;
-                m_getopt_table[j].val     = opt_defs[i].short_option;
+                m_getopt_table[j].val     = short_opt;
                 option_seen.set(short_opt);
                 ++j;
             }
+            else
+            {
+                assert (!"duplicate short option character");
+            }
         }
 
         //getopt_long requires a NULL final entry in the table: