# stage2: rework astgen command into \`zig ast-check\` · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b750e074c621b8679e14e53f9ecd2faa4432eff9)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b750e074c621b8679e14e53f9ecd2faa4432eff9

Requested commit: b750e074c621b8679e14e53f9ecd2faa4432eff9

Commit: b750e074c621b8679e14e53f9ecd2faa4432eff9

Tree: e76556b55be460c01787a18e40f5cc19482ade2a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: rework astgen command into `zig ast-check`

This addresses the use case of quickly reporting AstGen compile errors
for a file, for use with an IDE for example.

 * Rename from `zig asgen` to `zig ast-check`
 * It is now a command always available; not only in debug builds.
 * Give it usage text and proper CLI parsing.
 * Support reading from stdin when no positional arg is provided.
 * `-t` flag makes it print textual ZIR. Without this flag, it only
   provides compile errors.
 * Support `--color` parameter to override the tty detection

closes #8871

```

## Parents

- [51701fb2da3562363d2c4966c5bf5d1b0ccad1a6](https://git.cafe/gitcafe/zig/commit/51701fb2da3562363d2c4966c5bf5d1b0ccad1a6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b750e074c621b8679e14e53f9ecd2faa4432eff9?format=markdown)
