You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cargo --version / -V falls back to raw exec (parse_failure noise) #90
```
$ contextcrawler cargo --version
cargo 1.95.0 (f2d3ce0bd 2026-03-21)
$ sqlite3 history.db "SELECT error_message FROM parse_failures WHERE raw_command='cargo --version' LIMIT 1;"
error: unexpected argument '--version' found
```
58 parse_failure rows for `cargo --version` over 30 days. Each call works (command runs raw), but pollutes the parse_failure table and skips telemetry.
Root cause
`Commands::Cargo` (`src/main.rs:552`) only declares `build|test|clippy|check|fmt|install` as accepted subcommands. `--version` and `-V` aren't matched → clap rejects → `run_fallback` → no TOML match → raw exec.
Fix
Cleanest: pre-clap intercept. Match `cargo --version` / `cargo -V` (and `cargo --help`, `cargo -h`) and route straight to raw passthrough with proper tracking — same pattern as the existing `grep_format_flag_present` intercept.
// In run_cli():
let raw_args: Vec = std::env::args().skip(1).collect();
if raw_args.first().map(|s| s.as_str()) == Some("cargo")
&& cargo_passthrough_flag_present(&raw_args[1..])
{
return run_simple_passthrough("cargo", &raw_args[1..]);
}
```
Where `run_simple_passthrough` mirrors `run_grep_format_passthrough` but for a generic binary.
Bonus
The same pattern (--version/--help on a non-subcommand-aware wrapper) almost certainly affects other wrappers: `pnpm --version`, `npm --version`, `go version`, `docker --version`, `kubectl version`, etc. Worth a sweep — add a single shared `is_meta_flag(args)` helper and apply it across all wrapper intercepts.
Acceptance
`contextcrawler cargo --version` no longer creates a parse_failure row.
Same for `-V`, `--help`, `-h`.
A regression test in `tests/` confirms no parse_failure recorded for the four flags above on `cargo`.
Activity
merge: E cargo-test (#90 #91)
fix(cli): pre-clap meta-flag passthrough + tracking ignores test cont…