# init: replace '\-\-strip' with '\-\-minimal' · gitcafe/zig

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

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

Visibility: public

Requested revision: bb71a18ede1f976ad6d6bb7e84b88f0edc7d30e9

Requested commit: bb71a18ede1f976ad6d6bb7e84b88f0edc7d30e9

Commit: bb71a18ede1f976ad6d6bb7e84b88f0edc7d30e9

Tree: 0e9e71ae3feab6895666cade38096a1a8e3e2bda

Author: mlugg

Committer: Matthew Lugg

## Message

```
init: replace '--strip' with '--minimal'

This option never worked properly (it emitted wrongly-formatted code),
and it doesn't seem particularly *useful* -- someone who's proficient
enough with `std.Build` to not need explanations probably just wants to
write their own thing. Meanwhile, the use case of writing your own
`build.zig` was extremely poorly served, because `build.zig.zon` *needs*
to be generated programmatically for a correct `fingerprint`, but the
only ways to do that were to a) do it wrong and get an error, or b) get
the full init template and delete the vast majority of it. Both of these
were pretty clunky, and `-s` didn't really help.

So, replace this flag with a new one, `--minimal`/`-m`, which uses a
different template. This template is trivial enough that I opted to just
hardcode it into the compiler for simplicity. The main job of
`zig init -m` is to generate a correct `build.zig.zon` (if it is unable
to do this, it exits with a fatal error). In addition, it will *attempt*
to generate a tiny stub `build.zig`, with only an `std` import and an
empty `pub fn build`. However, if `build.zig` already exists, it will
avoid overwriting it, and doesn't even complain. This serves the use
case of writing `build.zig` manually and *then* running `zig init -m`
to generate an appropriate `build.zig.zon`.

```

## Parents

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

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