authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-02 23:33:25 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-02 23:33:25 -07:00
log30f101f0bb7e589e7359a0a647b048a5e7d9657d
tree5696ce7512ec1352637ef551b3742b29a7df5f6a
parent4ca5a1da9ec8b2fdb1dcdb04d2b3ac3dd50dfe15

add the `aq showjson` command


2 files changed, 17 insertions(+), 0 deletions(-)

src/cmd/aq.zig+1
......@@ -13,6 +13,7 @@ pub const commands = struct {
1313 pub const add = @import("./aquila/add.zig");
1414 pub const update = @import("./aquila/update.zig");
1515 pub const modfile = @import("./aquila/modfile.zig");
16 pub const showjson = @import("./aquila/showjson.zig");
1617};
1718
1819pub const server_root = "https://aquila.red";
src/cmd/aquila/showjson.zig created+16
......@@ -0,0 +1,16 @@
1const std = @import("std");
2const gpa = std.heap.c_allocator;
3
4const u = @import("./../../util/index.zig");
5const aq = @import("./../aq.zig");
6
7//
8//
9
10pub fn execute(args: [][]u8) !void {
11 const url = try std.mem.join(gpa, "/", &.{ aq.server_root, args[0] });
12 const val = try aq.server_fetch(url);
13
14 const out = std.io.getStdOut().writer();
15 try out.print("{}\n", .{val});
16}