mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-18 16:50:00 +00:00
Update cheatsheets
This commit is contained in:
41
zig
Normal file
41
zig
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# zig
|
||||
|
||||
> The Zig compiler and toolchain.
|
||||
> More information: <https://ziglang.org>.
|
||||
|
||||
- Compile the project in the current directory:
|
||||
|
||||
`zig build`
|
||||
|
||||
- Compile and run the project in the current directory:
|
||||
|
||||
`zig build run`
|
||||
|
||||
- Initialize a `zig build` application:
|
||||
|
||||
`zig init-exe`
|
||||
|
||||
- Initialize a `zig build` library:
|
||||
|
||||
`zig init-lib`
|
||||
|
||||
- Create and run a test build:
|
||||
|
||||
`zig test {{path/to/file.zig}}`
|
||||
|
||||
- Reformat Zig source into canonical form:
|
||||
|
||||
`zig fmt {{path/to/file.zig}}`
|
||||
|
||||
- Use Zig as a drop-in C compiler:
|
||||
|
||||
`zig cc {{path/to/file.c}}`
|
||||
|
||||
- Use Zig as a drop-in C++ compiler:
|
||||
|
||||
`zig c++ {{path/to/file.cpp}}`
|
||||
Reference in New Issue
Block a user