diff --git a/src/archive.zig b/src/archive.zig index e52990e..5b8e3be 100644 --- a/src/archive.zig +++ b/src/archive.zig @@ -74,7 +74,7 @@ pub fn initAdvanced(alloc: std.mem.Allocator, fil: File, offset: u64, threads: u .parent_alloc = alloc, .alloc = .{ .child_allocator = alloc }, // .fixed_buf = fixed_buf, - .thread_count = threads, + .thread_count = if (threads > 0) threads else try std.Thread.getCpuCount(), .fil = .init(fil, offset), .decomp = switch (super.compression) { .gzip => Decomp.gzipDecompress, diff --git a/src/bin/unsquashfs.zig b/src/bin/unsquashfs.zig index ef4640d..83b73af 100644 --- a/src/bin/unsquashfs.zig +++ b/src/bin/unsquashfs.zig @@ -15,7 +15,7 @@ const help_mgs = \\ \\ -o Start reading the archive at the given offset. \\ - \\ -p Specify how many threads to use. If no present, the system's logical cores count is used. + \\ -p Specify how many threads to use. If no present or zero, the system's logical cores count is used. \\ \\ --help Display this messages \\ --version Display the version @@ -83,9 +83,9 @@ fn handleArgs(alloc: std.mem.Allocator, out: *Writer) !void { }; continue; } else if (std.mem.eql(u8, arg, "--version")) { - try out.print("zig-unsquashfs version ", .{}); + try out.print("zig-unsquashfs v", .{}); try config.version.format(out); - try out.print("\nBuilt using Zig {s} with {} backend in {} mode.\n", .{ builtin.zig_version_string, builtin.zig_backend, builtin.mode }); + try out.print("\nBuilt using Zig {s}\n", .{ builtin.zig_version_string, builtin.zig_backend, builtin.mode }); std.process.exit(0); return; } else if (std.mem.eql(u8, arg, "--help")) {