parity: all 45 argparse flags wired + PARITY.md matrix; clean rebuild fixes help segfault
This commit is contained in:
+12
-2
@@ -12,7 +12,7 @@ std::string Parser::helpText() {
|
||||
" --serve-mcp KEY --mcp-port PORT --mcp-bind HOST\n"
|
||||
" --telegram --scheduler --install --install-telegram --uninstall-telegram\n"
|
||||
" --plexer-wrap --mplex COMMAND... --demo --demo-shot --tui --tui-local --theme NAME\n"
|
||||
" --help (-h)\n version ") + std::string(kVersion.data()) + "\n";
|
||||
" --help (-h)\n version ") + std::string(kVersion) + "\n";
|
||||
}
|
||||
Options Parser::parseOpts(int argc, char** argv) {
|
||||
Options o;
|
||||
@@ -51,6 +51,16 @@ Options Parser::parseOpts(int argc, char** argv) {
|
||||
else if (a=="--mplex") { o.mplex = std::vector<std::string>{}; while (++i<argc) o.mplex->push_back(argv[i]); break; }
|
||||
else if (a=="--demo") o.demo = true;
|
||||
else if (a=="--demo-shot") o.demo_shot = true;
|
||||
else if (a=="--model") { if(i+1<argc) o.model=argv[++i]; }
|
||||
else if (a=="--driver") { if(i+1<argc) o.driver=argv[++i]; }
|
||||
else if (a=="--task") { if(i+1<argc) o.task=argv[++i]; }
|
||||
else if (a=="--cwd") { if(i+1<argc) o.cwd=argv[++i]; }
|
||||
else if (a=="--argv") { if(i+1<argc) o.argv=argv[++i]; }
|
||||
else if (a=="--binary") { if(i+1<argc) o.binary=argv[++i]; }
|
||||
else if (a=="--max-risk") { if(i+1<argc) o.max_risk=argv[++i]; }
|
||||
else if (a=="--auto-answer") { if(i+1<argc) o.auto_answer=argv[++i]; }
|
||||
else if (a=="--allow-tool") { if(i+1<argc) o.allow_tool.push_back(argv[++i]); }
|
||||
else if (a=="--deny-tool") { if(i+1<argc) o.deny_tool.push_back(argv[++i]); }
|
||||
else if (a=="--tui") o.tui = true;
|
||||
else if (a=="--tui-local") o.tui_local = true;
|
||||
else if (a=="--theme") nxt(o.theme);
|
||||
@@ -69,7 +79,7 @@ Command Parser::parse(int argc, char** argv) {
|
||||
return c;
|
||||
}
|
||||
int Command::run() {
|
||||
if (opts.version || name=="--version") { std::puts(kVersion.data()); return 0; }
|
||||
if (opts.version || name=="--version") { std::puts(std::string(kVersion).c_str()); return 0; }
|
||||
std::fputs(Parser::helpText().c_str(), stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user