diff options
| author | Vexu <git@vexu.eu> | 2020-11-18 13:58:27 +0200 |
|---|---|---|
| committer | Vexu <git@vexu.eu> | 2020-11-18 13:58:27 +0200 |
| commit | da84ef2a9cd55bd3fdf8d2005a69ed9be86db689 (patch) | |
| tree | b7d5b307c3afb7eaf85b94f85289c926e08a6688 /src/main.zig | |
| parent | a39d3155b45cf2a1d5c91c7c82089c6f4ed7213c (diff) | |
| download | zig-da84ef2a9cd55bd3fdf8d2005a69ed9be86db689.tar.gz zig-da84ef2a9cd55bd3fdf8d2005a69ed9be86db689.zip | |
make help in commands more consistent
Closes #7101
Co-authored-by: pfg <pfg@pfg.pw>
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index 1a95605733..93efed16ee 100644 --- a/src/main.zig +++ b/src/main.zig @@ -46,6 +46,7 @@ const usage = \\ c++ Use Zig as a drop-in C++ compiler \\ env Print lib path, std path, cache directory, and version \\ fmt Reformat Zig source into canonical form + \\ help Print this help and exit \\ init-exe Initialize a `zig build` application in the cwd \\ init-lib Initialize a `zig build` library in the cwd \\ libc Display native libc paths file or validate one @@ -195,7 +196,7 @@ pub fn mainArgs(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v try @import("print_env.zig").cmdEnv(arena, cmd_args, io.getStdOut().outStream()); } else if (mem.eql(u8, cmd, "zen")) { try io.getStdOut().writeAll(info_zen); - } else if (mem.eql(u8, cmd, "help")) { + } else if (mem.eql(u8, cmd, "help") or mem.eql(u8, cmd, "-h") or mem.eql(u8, cmd, "--help")) { try io.getStdOut().writeAll(usage); } else { std.log.info("{}", .{usage}); |
