authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-27 06:19:48 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-27 06:19:48 -08:00
log4c13de3183c369d6d1260e34cf32619c63526481
tree1de51bf76a7dc018bf7fe1bc327e172a0bcd6714
parent3053f65a9e95eae137ea3427d6a866847f55e42e

clean up imports


13 files changed, 64 insertions(+), 14 deletions(-)

src/cmd/aq.zig-1
......@@ -1,7 +1,6 @@
11const std = @import("std");
22const string = []const u8;
33const gpa = std.heap.c_allocator;
4
54const zfetch = @import("zfetch");
65const json = @import("json");
76
src/cmd/aquila/install.zig-1
......@@ -1,7 +1,6 @@
11const std = @import("std");
22const string = []const u8;
33const gpa = std.heap.c_allocator;
4
54const knownfolders = @import("known-folders");
65
76const zigmod = @import("../../lib.zig");
src/cmd/fetch.zig+2-2
......@@ -1,12 +1,12 @@
11const std = @import("std");
22const string = []const u8;
3const ansi = @import("ansi");
4const root = @import("root");
35
46const zigmod = @import("../lib.zig");
57const u = @import("./../util/index.zig");
68const common = @import("./../common.zig");
79
8const ansi = @import("ansi");
9const root = @import("root");
1010const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {};
1111const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false;
1212
src/cmd/init.zig-1
......@@ -1,7 +1,6 @@
11const std = @import("std");
22const string = []const u8;
33const gpa = std.heap.c_allocator;
4
54const inquirer = @import("inquirer");
65const detectlicense = @import("detect-license");
76const knownfolders = @import("known-folders");
src/cmd/license.zig-1
......@@ -1,6 +1,5 @@
11const std = @import("std");
22const gpa = std.heap.c_allocator;
3
43const style = @import("ansi").style;
54const licenses = @import("licenses");
65
src/cmd/test.zig created+61
......@@ -0,0 +1,61 @@
1const std = @import("std");
2const string = []const u8;
3const gpa = std.heap.c_allocator;
4const range = @import("range").range;
5const zfetch = @import("zfetch");
6const ansi = @import("ansi");
7
8//
9//
10
11// https://www.thinkbroadband.com/download
12
13const Progress = struct {
14 const Item = struct {
15 max: usize,
16 current: usize,
17 done: bool,
18 };
19};
20
21var progress: std.ArrayList(Progress.Item) = undefined;
22var left: usize = 0;
23
24pub fn execute(args: [][]u8) !void {
25 _ = args;
26 // progress = std.ArrayList(Progress.Item).init(gpa);
27 // std.debug.print("\n", .{});
28
29 // for (range(3)) |_, i| {
30 // try progress.append(.{ .max = 1, .current = 0, .done = false });
31 // left += 1;
32 // try download("http://ipv4.download.thinkbroadband.com/100MB.zip", i);
33 // }
34
35 // while (left > 0) {
36 // for (progress.items) |it, i| {
37 // std.debug.print("{d}\t{d}\t{d}\t{d}%\n", .{ i, it.current, it.max, @divExact(it.current, it.max) });
38 // }
39 // std.debug.print("\n", .{});
40 // }
41 // for (progress.items) |it, i| {
42 // std.debug.print("{d}\t{d}\t{d}\t{d}%\n", .{ i, it.current, it.max, @divExact(it.current, it.max) });
43 // }
44}
45
46fn download(url: string, index: usize) void {
47 const req = zfetch.Request.init(gpa, url, null) catch {};
48 defer req.deinit();
49
50 req.do(.GET, null, null) catch {};
51
52 var buf: [std.mem.page_size]u8 = undefined;
53 const r = req.reader();
54 while (true) {
55 const len = r.readAll(&buf) catch {};
56 progress.items[index].current += len;
57 if (len < buf.len) break;
58 }
59 progress.items[index].done = true;
60 left -= 1;
61}
src/cmd/zpm.zig-1
......@@ -1,7 +1,6 @@
11const std = @import("std");
22const string = []const u8;
33const gpa = std.heap.c_allocator;
4
54const zfetch = @import("zfetch");
65const json = @import("json");
76
src/cmd/zpm/add.zig-1
......@@ -1,6 +1,5 @@
11const std = @import("std");
22const gpa = std.heap.c_allocator;
3
43const zfetch = @import("zfetch");
54
65const zigmod = @import("../../lib.zig");
src/cmd/zpm/search.zig-1
......@@ -1,6 +1,5 @@
11const std = @import("std");
22const gpa = std.heap.c_allocator;
3
43const zfetch = @import("zfetch");
54const json = @import("json");
65const range = @import("range").range;
src/cmd/zpm/showjson.zig-1
......@@ -1,6 +1,5 @@
11const std = @import("std");
22const gpa = std.heap.c_allocator;
3
43const zfetch = @import("zfetch");
54const json = @import("json");
65
src/cmd/zpm/tags.zig-1
......@@ -1,6 +1,5 @@
11const std = @import("std");
22const gpa = std.heap.c_allocator;
3
43const zfetch = @import("zfetch");
54const json = @import("json");
65const range = @import("range").range;
src/common.zig+1-2
......@@ -1,14 +1,13 @@
11const std = @import("std");
22const string = []const u8;
33const builtin = @import("builtin");
4
54const ansi = @import("ansi");
5const root = @import("root");
66
77const zigmod = @import("./lib.zig");
88const u = @import("./util/index.zig");
99const yaml = @import("./util/yaml.zig");
1010
11const root = @import("root");
1211const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {};
1312const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false;
1413
src/main.zig-1
......@@ -1,7 +1,6 @@
11const std = @import("std");
22const string = []const u8;
33const builtin = @import("builtin");
4
54pub const build_options = @import("build_options");
65const zigmod = @import("zigmod");
76const win32 = @import("win32");