| ... | ... | @@ -1,23 +1,9 @@ |
| 1 | 1 | ## `init` command |
| 2 | 2 | ``` |
| 3 | | zigmod init [name] [entry_point] |
| 3 | zigmod init |
| 4 | 4 | ``` |
| 5 | 5 | |
| 6 | | This command will generate a `zig.mod` file and place it in the current directory. `[name]` and `[entry_point]` can be used to override the default values. `[name]` defaults to the name of the current directory, optionally removing a `zig-` prefix from it. `[entry_point]` defaults to either `src/lib.zig` or `src/main.zig` in that order. |
| 7 | | |
| 8 | | The resulting file will look something like this: |
| 9 | | |
| 10 | | ```yml |
| 11 | | id: e8bx53yvuyhaudzhvoh16bov9ond5a5tp1zk76aflwtwsea7 |
| 12 | | name: hello |
| 13 | | main: src/main.zig |
| 14 | | dependencies: |
| 15 | | ``` |
| 16 | | |
| 17 | | - `id` is a randomly generated identifier that will uniquely identify your project coming from different versions or sources. |
| 18 | | - `name` is the string other developers will `@import` your package with. |
| 19 | | - `main` is the root Zig file of your package. |
| 20 | | - `dependencies` is a list that we'll add to later. |
| 6 | This command will help you generate a `zig.mod` file and place it in the current directory. This is the main file that will define various pieces of metadata about your project and manage your dependencies. The command will guide you though a number of questions that help you setup supporting files as well such as `.gitignore` and `LICENSE`. |
| 21 | 7 | |
| 22 | 8 | Check out the [`zig.mod` reference](./../zig.mod.md) for more info. |
| 23 | 9 | |