MCPcopy Create free account
hub / github.com/SoarGroup/Soar / Parse

Method Parse

Core/CLI/src/cli_Commands.h:1086–1163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1084 }
1085
1086 virtual bool Parse(std::vector< std::string >& argv)
1087 {
1088 cli::Options opt;
1089 OptionsData optionsData[] =
1090 {
1091 {'a', "all", OPTARG_NONE},
1092 {'c', "chunks", OPTARG_NONE},
1093 {'d', "default", OPTARG_NONE},
1094 {'r', "rl", OPTARG_NONE},
1095 {'t', "task", OPTARG_NONE},
1096 {'T', "template", OPTARG_NONE},
1097 {'u', "user", OPTARG_NONE},
1098 {0, 0, OPTARG_NONE}
1099 };
1100
1101 Cli::ExciseBitset options(0);
1102
1103 for (;;)
1104 {
1105 if (!opt.ProcessOptions(argv, optionsData))
1106 {
1107 return cli.SetError(opt.GetError().c_str());
1108 }
1109 ;
1110 if (opt.GetOption() == -1)
1111 {
1112 break;
1113 }
1114
1115 switch (opt.GetOption())
1116 {
1117 case 'a':
1118 options.set(Cli::EXCISE_ALL);
1119 break;
1120 case 'c':
1121 options.set(Cli::EXCISE_CHUNKS);
1122 break;
1123 case 'd':
1124 options.set(Cli::EXCISE_DEFAULT);
1125 break;
1126 case 'r':
1127 options.set(Cli::EXCISE_RL);
1128 break;
1129 case 't':
1130 options.set(Cli::EXCISE_TASK);
1131 break;
1132 case 'T':
1133 options.set(Cli::EXCISE_TEMPLATE);
1134 break;
1135 case 'u':
1136 options.set(Cli::EXCISE_USER);
1137 break;
1138 }
1139 }
1140
1141 // If there are options, no additional argument.
1142 if (options.any())
1143 {

Callers

nothing calls this directly

Calls 8

ProcessOptionsMethod · 0.80
GetNonOptionArgumentsMethod · 0.80
GetArgumentMethod · 0.80
SetErrorMethod · 0.45
GetOptionMethod · 0.45
setMethod · 0.45
anyMethod · 0.45
DoExciseMethod · 0.45

Tested by

no test coverage detected