Commit b74d2e0 1 parent 5064b62 commit b74d2e0 Copy full SHA for b74d2e0
File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -376,10 +376,11 @@ class SubArgGet
376
376
SubArgGet (const SubArgGet&) = delete ;
377
377
SubArgGet& operator =(const SubArgGet&) = delete ;
378
378
379
- SubArgGet (std::map <std::string, std::pair<std::list<SwitchArgBase*>, std::list<PosArg*>>> map)
379
+ SubArgGet (std::list <std::pair<std:: string, std::pair<std::list<SwitchArgBase*>, std::list<PosArg*> >>> map)
380
380
{
381
381
for (const auto & [subCommand, args] : map)
382
382
{
383
+ _order.push_back (subCommand);
383
384
_subCommands[subCommand] = ArgGet (args.first , args.second );
384
385
}
385
386
}
@@ -432,9 +433,9 @@ class SubArgGet
432
433
}
433
434
else
434
435
{
435
- for (const auto & [ subCommand, argGet] : _subCommands )
436
+ for (std::string subCommand : _order )
436
437
{
437
- help << _name << " " << subCommand << argGet ._argHelp () << std::endl;
438
+ help << _name << " " << subCommand << _subCommands. at (subCommand) ._argHelp () << std::endl;
438
439
}
439
440
}
440
441
return help.str ();
@@ -454,6 +455,7 @@ class SubArgGet
454
455
std::string _name;
455
456
std::string _subCommand;
456
457
std::map<std::string, ArgGet> _subCommands;
458
+ std::list<std::string> _order;
457
459
std::string _errMsg;
458
460
459
461
};
You can’t perform that action at this time.
0 commit comments