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 @@...@@ -1,7 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const gpa = std.heap.c_allocator;3const gpa = std.heap.c_allocator;
4
5const zfetch = @import("zfetch");4const zfetch = @import("zfetch");
6const json = @import("json");5const json = @import("json");
76
src/cmd/aquila/install.zig-1
...@@ -1,7 +1,6 @@...@@ -1,7 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const gpa = std.heap.c_allocator;3const gpa = std.heap.c_allocator;
4
5const knownfolders = @import("known-folders");4const knownfolders = @import("known-folders");
65
7const zigmod = @import("../../lib.zig");6const zigmod = @import("../../lib.zig");
src/cmd/fetch.zig+2-2
...@@ -1,12 +1,12 @@...@@ -1,12 +1,12 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const ansi = @import("ansi");
4const root = @import("root");
35
4const zigmod = @import("../lib.zig");6const zigmod = @import("../lib.zig");
5const u = @import("./../util/index.zig");7const u = @import("./../util/index.zig");
6const common = @import("./../common.zig");8const common = @import("./../common.zig");
79
8const ansi = @import("ansi");
9const root = @import("root");
10const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {};10const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {};
11const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false;11const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false;
1212
src/cmd/init.zig-1
...@@ -1,7 +1,6 @@...@@ -1,7 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const gpa = std.heap.c_allocator;3const gpa = std.heap.c_allocator;
4
5const inquirer = @import("inquirer");4const inquirer = @import("inquirer");
6const detectlicense = @import("detect-license");5const detectlicense = @import("detect-license");
7const knownfolders = @import("known-folders");6const knownfolders = @import("known-folders");
src/cmd/license.zig-1
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const gpa = std.heap.c_allocator;2const gpa = std.heap.c_allocator;
3
4const style = @import("ansi").style;3const style = @import("ansi").style;
5const licenses = @import("licenses");4const 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 @@...@@ -1,7 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const gpa = std.heap.c_allocator;3const gpa = std.heap.c_allocator;
4
5const zfetch = @import("zfetch");4const zfetch = @import("zfetch");
6const json = @import("json");5const json = @import("json");
76
src/cmd/zpm/add.zig-1
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const gpa = std.heap.c_allocator;2const gpa = std.heap.c_allocator;
3
4const zfetch = @import("zfetch");3const zfetch = @import("zfetch");
54
6const zigmod = @import("../../lib.zig");5const zigmod = @import("../../lib.zig");
src/cmd/zpm/search.zig-1
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const gpa = std.heap.c_allocator;2const gpa = std.heap.c_allocator;
3
4const zfetch = @import("zfetch");3const zfetch = @import("zfetch");
5const json = @import("json");4const json = @import("json");
6const range = @import("range").range;5const range = @import("range").range;
src/cmd/zpm/showjson.zig-1
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const gpa = std.heap.c_allocator;2const gpa = std.heap.c_allocator;
3
4const zfetch = @import("zfetch");3const zfetch = @import("zfetch");
5const json = @import("json");4const json = @import("json");
65
src/cmd/zpm/tags.zig-1
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const gpa = std.heap.c_allocator;2const gpa = std.heap.c_allocator;
3
4const zfetch = @import("zfetch");3const zfetch = @import("zfetch");
5const json = @import("json");4const json = @import("json");
6const range = @import("range").range;5const range = @import("range").range;
src/common.zig+1-2
...@@ -1,14 +1,13 @@...@@ -1,14 +1,13 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const builtin = @import("builtin");3const builtin = @import("builtin");
4
5const ansi = @import("ansi");4const ansi = @import("ansi");
5const root = @import("root");
66
7const zigmod = @import("./lib.zig");7const zigmod = @import("./lib.zig");
8const u = @import("./util/index.zig");8const u = @import("./util/index.zig");
9const yaml = @import("./util/yaml.zig");9const yaml = @import("./util/yaml.zig");
1010
11const root = @import("root");
12const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {};11const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {};
13const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false;12const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false;
1413
src/main.zig-1
...@@ -1,7 +1,6 @@...@@ -1,7 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const builtin = @import("builtin");3const builtin = @import("builtin");
4
5pub const build_options = @import("build_options");4pub const build_options = @import("build_options");
6const zigmod = @import("zigmod");5const zigmod = @import("zigmod");
7const win32 = @import("win32");6const win32 = @import("win32");