summaryrefslogtreecommitdiff
path: root/src/main.zig
blob: 81317f1346bdc113f807266c8fef9ef2236bb025 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const std = @import("std");
const weatherFetcher = @import("weatherFetcher.zig");

pub fn main() !void{
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();
    const allocator = gpa.allocator();

    const args = try std.process.argsAlloc(allocator);
    defer std.process.argsFree(allocator, args);

    var daily = try weatherFetcher.getDailyData(allocator, weatherFetcher.Location{
        .lat=52.52, .lon=13.41,
    });
    defer daily.deinit();

    const stdout = std.io.getStdOut().writer();
    try stdout.print("Weather app {s}\n", .{args});
    std.debug.print("{}\n", .{daily.data});
}