Update src/main.zig
This commit is contained in:
parent
d6a31f3c01
commit
ee49da6f22
1 changed files with 13 additions and 10 deletions
23
src/main.zig
23
src/main.zig
|
@ -1,24 +1,27 @@
|
|||
const std = @import("std");
|
||||
const url = @import("url.zig");
|
||||
const url = @import("url.zig");
|
||||
const json = @import("json.zig");
|
||||
|
||||
const dbg_print = std.debug.print;
|
||||
const eql = std.mem.eql;
|
||||
|
||||
|
||||
pub fn main() !void {
|
||||
// gpa allocator
|
||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||
defer _ = gpa.deinit();
|
||||
defer _ = gpa.deinit();
|
||||
const allocator = gpa.allocator();
|
||||
|
||||
var args = try std.process.argsWithAllocator(allocator);
|
||||
defer args.deinit();
|
||||
const args = try std.process.argsAlloc(allocator);
|
||||
defer std.process.argsFree(allocator, args);
|
||||
|
||||
while (args.next()) |arg| {
|
||||
dbg_print("{s}", .{arg});
|
||||
if (eql(u8, args[1], "help")) {
|
||||
dbg_print("Help :)\n", .{});
|
||||
}
|
||||
|
||||
const data = try url.fetch(allocator, "https://tidal.401658.xyz/track/?id=286266927&quality=LOSSLESS");
|
||||
defer allocator.free(data);
|
||||
|
||||
const data = try url.fetch(allocator, "https://tidal.401658.xyz/track/?id=286266927&quality=LOSSLESS");
|
||||
defer allocator.free(data);
|
||||
|
||||
try json.extract(allocator, data);
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue