From 41adea57aad76958cc4239da41a3f6ac5d674304 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Sat, 7 Dec 2024 00:18:38 +0000 Subject: [PATCH] Update cheatsheets --- tldr/fd | 6 +++--- tldr/zig | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tldr/fd b/tldr/fd index bfbcd929..2761ed78 100644 --- a/tldr/fd +++ b/tldr/fd @@ -13,13 +13,13 @@ source: https://github.com/tldr-pages/tldr.git `fd "{{string|regex}}"` -- Find files that begin with `foo`: +- Find files that begin with a specific string: -`fd "^foo"` +`fd "{{^string}}"` - Find files with a specific extension: -`fd --extension txt` +`fd --extension {{txt}}` - Find files in a specific directory: diff --git a/tldr/zig b/tldr/zig index 593c0a49..c0368807 100644 --- a/tldr/zig +++ b/tldr/zig @@ -16,25 +16,25 @@ source: https://github.com/tldr-pages/tldr.git `zig build run` -- Initialize a `zig build` application: +- Initialize a `zig build` project with library and executable: -`zig init-exe` - -- Initialize a `zig build` library: - -`zig init-lib` +`zig init` - Create and run a test build: `zig test {{path/to/file.zig}}` +- Cross compile, build and run a project for `x86_64` architecture and `windows` operating system: + +`zig build run -fwine -Dtarget=x86_64-windows` + - Reformat Zig source into canonical form: `zig fmt {{path/to/file.zig}}` -- Use Zig as a drop-in C compiler: +- Translate a C file to `zig`: -`zig cc {{path/to/file.c}}` +`zig translate-c -lc {{path/to/file.c}}` - Use Zig as a drop-in C++ compiler: