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;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ struct Options {
|
||||
std::optional<std::vector<std::string>> mplex; // REMAINDER
|
||||
bool demo = false, demo_shot = false, tui = false, tui_local = false;
|
||||
std::optional<std::string> theme;
|
||||
std::string model, driver, task, cwd, argv, binary;
|
||||
std::string max_risk = "low", auto_answer;
|
||||
std::vector<std::string> allow_tool, deny_tool;
|
||||
bool help = false;
|
||||
std::vector<std::string> prompt;
|
||||
};
|
||||
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# e2e: same prompt via tai.py stubs vs detz; diff behavior
|
||||
P="$1"
|
||||
PY=$(cd .. && timeout 20 python3 tai.py --help 2>&1 | head -3)
|
||||
DZ=$(timeout 20 ./build/detz --help 2>&1 | head -3)
|
||||
echo "--- tai.py:"; echo "$PY" | head -2
|
||||
echo "--- detz:"; echo "$DZ" | head -2
|
||||
Reference in New Issue
Block a user