This was printing arguments twice in dash-dash aliases; don't do that

llvm-svn: 263517
This commit is contained in:
Enrico Granata 2016-03-15 01:17:32 +00:00
parent c11460e051
commit 4ebb8a4761
1 changed files with 25 additions and 25 deletions

View File

@ -511,6 +511,8 @@ Options::GenerateOptionUsage
uint32_t i;
if (!only_print_args)
{
for (uint32_t opt_set = 0; opt_set < num_option_sets; ++opt_set)
{
uint32_t opt_set_mask;
@ -525,8 +527,6 @@ Options::GenerateOptionUsage
if (cmd)
cmd->GetFormattedCommandArguments(args_str, opt_set_mask);
if (!only_print_args)
{
// First go through and print all options that take no arguments as
// a single string. If a command has "-a" "-b" and "-c", this will show
// up as [-abc]
@ -619,7 +619,6 @@ Options::GenerateOptionUsage
PrintOption (opt_defs[i], eDisplayBestOption, " ", nullptr, true, strm);
}
}
}
if (args_str.GetSize() > 0)
{
@ -631,12 +630,13 @@ Options::GenerateOptionUsage
break;
}
}
}
if (cmd &&
cmd->WantsRawCommandString() &&
(only_print_args || cmd->WantsRawCommandString()) &&
arguments_str.GetSize() > 0)
{
strm.PutChar('\n');
if (!only_print_args) strm.PutChar('\n');
strm.Indent(name);
strm.Printf(" %s", arguments_str.GetData());
}