@@ -8,9 +8,9 @@ const std = @import("std");
8
8
// <ops...> is a list of operations that should be performed on the file system:
9
9
// - format Formats the disk image.
10
10
// - mount Mounts the file system, must be before all following:
11
- // - mkdir: <dst> Creates directory <dst> and all necessary parents.
12
- // - file: <src>: <dst> Copy <src> to path <dst>. If <dst> exists, it will be overwritten.
13
- // - dir: <src>: <dst> Copy <src> recursively into <dst>. If <dst> exists, they will be merged.
11
+ // - mkdir; <dst> Creates directory <dst> and all necessary parents.
12
+ // - file; <src>; <dst> Copy <src> to path <dst>. If <dst> exists, it will be overwritten.
13
+ // - dir; <src>; <dst> Copy <src> recursively into <dst>. If <dst> exists, they will be merged.
14
14
//
15
15
// <dst> paths are always rooted, even if they don't start with a /, and always use / as a path separator.
16
16
//
@@ -56,7 +56,7 @@ pub fn App(comptime Context: type) type {
56
56
if (byte_base + byte_len > stat .size )
57
57
return mistake ("invalid offsets." , .{});
58
58
59
- device = BlockDevice {
59
+ device = . {
60
60
.file = & image_file ,
61
61
.base = byte_base ,
62
62
.count = byte_len / BlockDevice .block_size ,
@@ -84,15 +84,15 @@ pub fn App(comptime Context: type) type {
84
84
try Context .mount ();
85
85
},
86
86
.mkdir = > {
87
- const dir = try normalize (cmd_iter .next () orelse return mistake ("mkdir: <dst> is missing it's <dst> path!" , .{}));
87
+ const dir = try normalize (cmd_iter .next () orelse return mistake ("mkdir; <dst> is missing it's <dst> path!" , .{}));
88
88
89
89
// std.log.info("mkdir(\"{}\")", .{std.zig.fmtEscapes(dir)});
90
90
91
91
try recursiveMkDir (dir );
92
92
},
93
93
.file = > {
94
- const src = cmd_iter .next () orelse return mistake ("file: <src>: <dst> is missing it's <src> path!" , .{});
95
- const dst = try normalize (cmd_iter .next () orelse return mistake ("file: <src>: <dst> is missing it's <dst> path!" , .{}));
94
+ const src = cmd_iter .next () orelse return mistake ("file; <src>; <dst> is missing it's <src> path!" , .{});
95
+ const dst = try normalize (cmd_iter .next () orelse return mistake ("file; <src>; <dst> is missing it's <dst> path!" , .{}));
96
96
97
97
// std.log.info("file(\"{}\", \"{}\")", .{ std.zig.fmtEscapes(src), std.zig.fmtEscapes(dst) });
98
98
@@ -108,10 +108,8 @@ pub fn App(comptime Context: type) type {
108
108
try addFile (file , dst );
109
109
},
110
110
.dir = > {
111
- const src = cmd_iter .next () orelse return mistake ("dir:<src>:<dst> is missing it's <src> path!" , .{});
112
- const dst = try normalize (cmd_iter .next () orelse return mistake ("dir:<src>:<dst> is missing it's <dst> path!" , .{}));
113
-
114
- // std.log.info("dir(\"{}\", \"{}\")", .{ std.zig.fmtEscapes(src), std.zig.fmtEscapes(dst) });
111
+ const src = cmd_iter .next () orelse return mistake ("dir;<src>;<dst> is missing it's <src> path!" , .{});
112
+ const dst = try normalize (cmd_iter .next () orelse return mistake ("dir;<src>;<dst> is missing it's <dst> path!" , .{}));
115
113
116
114
var iter_dir = try std .fs .cwd ().openDir (src , .{ .iterate = true });
117
115
defer iter_dir .close ();
0 commit comments