File tree Expand file tree Collapse file tree
base/cvd/cuttlefish/host/commands/cvd/cli/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ Result<std::string> CvdCommandHandler::DetailedHelp(
5555 cvd_common::Args args = request.SubcommandArguments ();
5656 CF_EXPECT (ConsumeFlags (flags, args));
5757
58+ // Make sure the flags are in alphabetical order
59+ std::sort (flags.begin (), flags.end ());
60+
5861 selector::SelectorOptions selector_options = request.Selectors ();
5962 if (RequiresDeviceExists ()) {
6063 // Add the common selector flags if the command supports them. This doesn't
@@ -63,12 +66,9 @@ Result<std::string> CvdCommandHandler::DetailedHelp(
6366 // "current value" is correct.
6467 std::vector<Flag> selector_flags =
6568 selector::BuildCommonSelectorFlags (selector_options);
66- flags.insert (flags.end (), selector_flags.begin (), selector_flags.end ());
69+ flags.insert (flags.begin (), selector_flags.begin (), selector_flags.end ());
6770 }
6871
69- // Make sure the flags are in alphabetical order
70- std::sort (flags.begin (), flags.end ());
71-
7272 ss << FormatFlagsHelp (flags);
7373
7474 return ss.str ();
You can’t perform that action at this time.
0 commit comments