| ... | @@ -41,11 +41,11 @@ const usage = | ... | @@ -41,11 +41,11 @@ const usage = |
| 41 | \\ build Build project from build.zig | 41 | \\ build Build project from build.zig |
| 42 | \\ build-exe Create executable from source or object files | 42 | \\ build-exe Create executable from source or object files |
| 43 | \\ build-lib Create library from source or object files | 43 | \\ build-lib Create library from source or object files |
| 44 | \\ build-obj Create object from source or assembly | 44 | \\ build-obj Create object from source or object files |
| 45 | \\ cc Use Zig as a drop-in C compiler | 45 | \\ cc Use Zig as a drop-in C compiler |
| 46 | \\ c++ Use Zig as a drop-in C++ compiler | 46 | \\ c++ Use Zig as a drop-in C++ compiler |
| 47 | \\ env Print lib path, std path, compiler id and version | 47 | \\ env Print lib path, std path, cache directory, and version |
| 48 | \\ fmt Parse file and render in canonical zig format | 48 | \\ fmt Reformat Zig source into canonical form |
| 49 | \\ init-exe Initialize a `zig build` application in the cwd | 49 | \\ init-exe Initialize a `zig build` application in the cwd |
| 50 | \\ init-lib Initialize a `zig build` library in the cwd | 50 | \\ init-lib Initialize a `zig build` library in the cwd |
| 51 | \\ libc Display native libc paths file or validate one | 51 | \\ libc Display native libc paths file or validate one |
| ... | @@ -54,11 +54,11 @@ const usage = | ... | @@ -54,11 +54,11 @@ const usage = |
| 54 | \\ targets List available compilation targets | 54 | \\ targets List available compilation targets |
| 55 | \\ test Create and run a test build | 55 | \\ test Create and run a test build |
| 56 | \\ version Print version number and exit | 56 | \\ version Print version number and exit |
| 57 | \\ zen Print zen of zig and exit | 57 | \\ zen Print Zen of Zig and exit |
| 58 | \\ | 58 | \\ |
| 59 | \\General Options: | 59 | \\General Options: |
| 60 | \\ | 60 | \\ |
| 61 | \\ --help Print command-specific usage | 61 | \\ -h, --help Print command-specific usage |
| 62 | \\ | 62 | \\ |
| 63 | ; | 63 | ; |
| 64 | | 64 | |
| ... | @@ -2020,7 +2020,7 @@ pub fn cmdLibC(gpa: *Allocator, args: []const []const u8) !void { | ... | @@ -2020,7 +2020,7 @@ pub fn cmdLibC(gpa: *Allocator, args: []const []const u8) !void { |
| 2020 | while (i < args.len) : (i += 1) { | 2020 | while (i < args.len) : (i += 1) { |
| 2021 | const arg = args[i]; | 2021 | const arg = args[i]; |
| 2022 | if (mem.startsWith(u8, arg, "-")) { | 2022 | if (mem.startsWith(u8, arg, "-")) { |
| 2023 | if (mem.eql(u8, arg, "--help")) { | 2023 | if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 2024 | const stdout = io.getStdOut().writer(); | 2024 | const stdout = io.getStdOut().writer(); |
| 2025 | try stdout.writeAll(usage_libc); | 2025 | try stdout.writeAll(usage_libc); |
| 2026 | return cleanExit(); | 2026 | return cleanExit(); |
| ... | @@ -2062,7 +2062,7 @@ pub const usage_init = | ... | @@ -2062,7 +2062,7 @@ pub const usage_init = |
| 2062 | \\ directory. | 2062 | \\ directory. |
| 2063 | \\ | 2063 | \\ |
| 2064 | \\Options: | 2064 | \\Options: |
| 2065 | \\ --help Print this help and exit | 2065 | \\ -h, --help Print this help and exit |
| 2066 | \\ | 2066 | \\ |
| 2067 | \\ | 2067 | \\ |
| 2068 | ; | 2068 | ; |
| ... | @@ -2151,7 +2151,7 @@ pub const usage_build = | ... | @@ -2151,7 +2151,7 @@ pub const usage_build = |
| 2151 | \\ Build a project from build.zig. | 2151 | \\ Build a project from build.zig. |
| 2152 | \\ | 2152 | \\ |
| 2153 | \\Options: | 2153 | \\Options: |
| 2154 | \\ --help Print this help and exit | 2154 | \\ -h, --help Print this help and exit |
| 2155 | \\ | 2155 | \\ |
| 2156 | \\ | 2156 | \\ |
| 2157 | ; | 2157 | ; |
| ... | @@ -2403,7 +2403,7 @@ pub const usage_fmt = | ... | @@ -2403,7 +2403,7 @@ pub const usage_fmt = |
| 2403 | \\ recursively. | 2403 | \\ recursively. |
| 2404 | \\ | 2404 | \\ |
| 2405 | \\Options: | 2405 | \\Options: |
| 2406 | \\ --help Print this help and exit | 2406 | \\ -h, --help Print this help and exit |
| 2407 | \\ --color [auto|off|on] Enable or disable colored error messages | 2407 | \\ --color [auto|off|on] Enable or disable colored error messages |
| 2408 | \\ --stdin Format code from stdin; output to stdout | 2408 | \\ --stdin Format code from stdin; output to stdout |
| 2409 | \\ --check List non-conforming files and exit with an error | 2409 | \\ --check List non-conforming files and exit with an error |
| ... | @@ -2435,7 +2435,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void { | ... | @@ -2435,7 +2435,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void { |
| 2435 | while (i < args.len) : (i += 1) { | 2435 | while (i < args.len) : (i += 1) { |
| 2436 | const arg = args[i]; | 2436 | const arg = args[i]; |
| 2437 | if (mem.startsWith(u8, arg, "-")) { | 2437 | if (mem.startsWith(u8, arg, "-")) { |
| 2438 | if (mem.eql(u8, arg, "--help")) { | 2438 | if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 2439 | const stdout = io.getStdOut().outStream(); | 2439 | const stdout = io.getStdOut().outStream(); |
| 2440 | try stdout.writeAll(usage_fmt); | 2440 | try stdout.writeAll(usage_fmt); |
| 2441 | return cleanExit(); | 2441 | return cleanExit(); |