summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/Options.cpp
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-10-01 19:59:14 +0000
committerCaroline Tice <ctice@apple.com>2010-10-01 19:59:14 +0000
commitdeaab2220e0ac8bc3f4e34c23f4f5cca378ad6a9 (patch)
tree3e28d80f6cd1737b60350b6766899048b3a5b0be /lldb/source/Interpreter/Options.cpp
parent3f6b753f9d51d7804d8629550a42851d1903e18f (diff)
downloadbcm5719-llvm-deaab2220e0ac8bc3f4e34c23f4f5cca378ad6a9.tar.gz
bcm5719-llvm-deaab2220e0ac8bc3f4e34c23f4f5cca378ad6a9.zip
Modify command options to use the new arguments mechanism. Now all command option
arguments are specified in a standardized way, will have a standardized name, and have functioning help. The next step is to start writing useful help for all the argument types. llvm-svn: 115335
Diffstat (limited to 'lldb/source/Interpreter/Options.cpp')
-rw-r--r--lldb/source/Interpreter/Options.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp
index 0ab6bdffda9..fcf048b4412 100644
--- a/lldb/source/Interpreter/Options.cpp
+++ b/lldb/source/Interpreter/Options.cpp
@@ -484,20 +484,21 @@ Options::GenerateOptionUsage
if (full_options_table[i].usage_mask & opt_set_mask)
{
// Add current option to the end of out_stream.
-
+ CommandArgumentType arg_type = full_options_table[i].argument_type;
+
if (full_options_table[i].required)
{
if (full_options_table[i].option_has_arg == required_argument)
{
- strm.Printf (" -%c %s",
- full_options_table[i].short_option,
- full_options_table[i].argument_name);
+ strm.Printf (" -%c <%s>",
+ full_options_table[i].short_option,
+ CommandObject::GetArgumentName (arg_type));
}
else if (full_options_table[i].option_has_arg == optional_argument)
{
- strm.Printf (" -%c [%s]",
+ strm.Printf (" -%c [<%s>]",
full_options_table[i].short_option,
- full_options_table[i].argument_name);
+ CommandObject::GetArgumentName (arg_type));
}
}
}
@@ -511,14 +512,16 @@ Options::GenerateOptionUsage
{
// Add current option to the end of out_stream.
+ CommandArgumentType arg_type = full_options_table[i].argument_type;
+
if (! full_options_table[i].required)
{
if (full_options_table[i].option_has_arg == required_argument)
- strm.Printf (" [-%c %s]", full_options_table[i].short_option,
- full_options_table[i].argument_name);
+ strm.Printf (" [-%c <%s>]", full_options_table[i].short_option,
+ CommandObject::GetArgumentName (arg_type));
else if (full_options_table[i].option_has_arg == optional_argument)
- strm.Printf (" [-%c [%s]]", full_options_table[i].short_option,
- full_options_table[i].argument_name);
+ strm.Printf (" [-%c [<%s>]]", full_options_table[i].short_option,
+ CommandObject::GetArgumentName (arg_type));
}
}
}
@@ -578,13 +581,18 @@ Options::GenerateOptionUsage
else
strm.EOL();
+ CommandArgumentType arg_type = full_options_table[i].argument_type;
+
+ StreamString arg_name_str;
+ arg_name_str.Printf ("<%s>", CommandObject::GetArgumentName (arg_type));
+
strm.Indent ();
strm.Printf ("-%c", full_options_table[i].short_option);
- if (full_options_table[i].argument_name != NULL)
- strm.Printf (" %s", full_options_table[i].argument_name);
+ if (arg_type != eArgTypeNone)
+ strm.Printf (" <%s>", CommandObject::GetArgumentName (arg_type));
strm.Printf (" ( --%s", full_options_table[i].long_option);
- if (full_options_table[i].argument_name != NULL)
- strm.Printf (" %s", full_options_table[i].argument_name);
+ if (arg_type != eArgTypeNone)
+ strm.Printf (" <%s>", CommandObject::GetArgumentName (arg_type));
strm.PutCString(" )\n");
strm.IndentMore (5);
OpenPOWER on IntegriCloud