Skip to content

Commit d1e2106

Browse files
committed
add help for dotall
1 parent 13d2b98 commit d1e2106

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/zigpkg.zig

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ pub fn cmd_dot(opt: GlobalOptions, args: []const []const u8) !u8 {
319319
\\
320320
\\usage: zigpkg dot {--help|build_root_path|--} [zig args]
321321
\\
322-
\\rerun "zig build" and output a graphviz ".dot" file of all build steps
322+
\\rerun "zig build" and output a graphviz ".dot" file of build steps based on args
323323
\\
324324
\\
325325
;
@@ -346,10 +346,21 @@ pub fn cmd_dot(opt: GlobalOptions, args: []const []const u8) !u8 {
346346
}
347347

348348
pub fn cmd_dotall(opt: GlobalOptions, args: []const []const u8) !u8 {
349+
const cmd_usage =
350+
\\
351+
\\usage: zigpkg dotall {--help|build_root_path|--} [zig args]
352+
\\
353+
\\rerun "zig build" and output a graphviz ".dot" file of all build steps
354+
\\
355+
\\
356+
;
349357
var arg_sep: usize = 0;
350358
var root: []const u8 = ".";
351359
for (args) |arg| {
352-
if (std.mem.eql(u8, arg, "--")) {
360+
if (helpArg(&.{arg})) {
361+
try opt.stdout.writeAll(cmd_usage);
362+
return std.process.exit(0);
363+
} else if (std.mem.eql(u8, arg, "--")) {
353364
arg_sep += 1;
354365
break;
355366
} else if (arg_sep == 0) {

0 commit comments

Comments
 (0)