Skip to content

fix(cli): add zig to the --language choices for parse and scan#119

Open
gadievron wants to merge 1 commit into
masterfrom
fix/cli-zig-language-choice
Open

fix(cli): add zig to the --language choices for parse and scan#119
gadievron wants to merge 1 commit into
masterfrom
fix/cli-zig-language-choice

Conversation

@gadievron

Copy link
Copy Markdown
Collaborator

fix(cli): add zig to the --language choices for parse and scan

Problem

openant parse --language zig (and scan) fails with argument --language/-l: invalid choice: 'zig'. The Zig parser is fully wired everywhere else: core/parser_adapter.parse_repository dispatches language == "zig", detect_language() returns "zig" and lists it in its docstring + the "no source files" error, and config/languages.json maps .zigzig. Only the explicit --language argparse choices list in openant/cli.py (for both parse and scan) was never updated — so Zig was reachable via --language auto but not by explicit selection.

Fix

Add "zig" to the choices list at both cli.py sites (parse + scan). Purely additive; exposes nothing new — auto already routed .zig repos to the Zig parser.

Verification

$ openant parse /tmp/zig-kf --language zig --level reachable
  Found 2 Zig files
  After reachable filter: 9 functions     # was: error: invalid choice: 'zig'

Not a security fix

CLI usability fix.

Tests

No test pins the --language choices list (verified: grep -rn 'choices=\[.auto' tests/ = 0). The change is a 2-line argparse addition.

Depends-on

None (standalone; the choices list is pre-existing on master).

The zig parser is dispatched by parse_repository (core/parser_adapter.py:126)
and has a working test_pipeline, but 'zig' was missing from the parse/scan
--language choices, so 'openant parse --language zig' errored with 'invalid
choice'. Pre-existing gap (present on master); surfaced while verifying the
library-mode work — zig library-mode is unreachable via the CLI without this.

Verified: 'openant parse /tmp/zig-kf --language zig --level reachable
--library-mode' now runs (9 -> 21 reachable functions under library-mode).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant