#include <gio/gio.h>
#include <stdio.h>

int main(int argc, char **argv) {
    GError *error = NULL;

    if (argc != 2) {
        fprintf(stderr, "Usage: %s PATH\n", argv[0]);
        return 1;
    }

    g_type_init();

    printf("Launching...\n");
    if (g_app_info_launch_default_for_uri(argv[1], NULL, &error)) {
        printf("Success!\n");
    } else {
        printf("Failed: %s\n", error->message);
        g_error_free(error);
    }

    return 0;
}
