@@ -756,7 +756,7 @@ void OptTable::internalPrintHelp(
756756 // pairs.
757757 std::map<std::string, std::vector<OptionInfo>> GroupedOptionHelp;
758758
759- auto ActiveSubCommand =
759+ const auto ActiveSubCommand =
760760 std::find_if (SubCommands.begin (), SubCommands.end (),
761761 [&](const auto &C) { return SubCommand == C.Name ; });
762762 if (!SubCommand.empty ()) {
@@ -775,24 +775,30 @@ void OptTable::internalPrintHelp(
775775 }
776776
777777 auto DoesOptionBelongToSubcommand = [&](const Info &CandidateInfo) {
778- // Retrieve the SubCommandIDs registered to the given current CandidateInfo Option.
778+ // Retrieve the SubCommandIDs registered to the given current CandidateInfo
779+ // Option.
779780 ArrayRef<unsigned > SubCommandIDs =
780781 CandidateInfo.getCommandIDs (SubCommandIDsTable);
781782
782783 // If no registered subcommands, then only global options are to be printed.
783- // If no valid SubCommand (empty) in commandline then print the current global CandidateInfo Option.
784+ // If no valid SubCommand (empty) in commandline then print the current
785+ // global CandidateInfo Option.
784786 if (SubCommandIDs.empty ())
785787 return SubCommand.empty ();
786-
788+
787789 // Handle CandidateInfo Option which has at least one registered SubCommand.
788- // If no valid SubCommand (empty) in commandline, this CandidateInfo option should not be printed.
790+ // If no valid SubCommand (empty) in commandline, this CandidateInfo option
791+ // should not be printed.
789792 if (SubCommand.empty ())
790793 return false ;
791794
792- // Find the ID of the valid subcommand passed in commandline (its index in the SubCommands table which contains all subcommands).
795+ // Find the ID of the valid subcommand passed in commandline (its index in
796+ // the SubCommands table which contains all subcommands).
793797 unsigned ActiveSubCommandID = ActiveSubCommand - &SubCommands[0 ];
794- // Print if the ActiveSubCommandID is registered with the CandidateInfo Option.
795- return std::find (SubCommandIDs.begin (), SubCommandIDs.end (), ActiveSubCommandID) != SubCommandIDs.end ();
798+ // Print if the ActiveSubCommandID is registered with the CandidateInfo
799+ // Option.
800+ return std::find (SubCommandIDs.begin (), SubCommandIDs.end (),
801+ ActiveSubCommandID) != SubCommandIDs.end ();
796802 };
797803
798804 for (unsigned Id = 1 , e = getNumOptions () + 1 ; Id != e; ++Id) {
0 commit comments