10std::vector<TclObject>
parseTclArgs(
Interpreter& interp, std::span<const TclObject> inArgs, std::span<const ArgsInfo> table)
12 std::vector<TclObject> outArgs;
13 outArgs.reserve(inArgs.size());
15 while (!inArgs.empty()) {
16 auto arg = inArgs.front();
17 auto argStr = arg.getString();
18 inArgs = inArgs.subspan<1>();
19 if (argStr.starts_with(
'-')) {
21 append(outArgs, inArgs);
25 if (it == table.end()) {
27 "Invalid option: '", argStr,
"'. Must be one of ",
29 return strCat(
'\'', info.name,
'\'');
32 auto consumed = it->func(interp, inArgs);
33 inArgs = inArgs.subspan(consumed);
35 outArgs.push_back(arg);