From: Ayabusa Date: Sun, 7 Jun 2026 19:01:54 +0000 (+0200) Subject: Error message X-Git-Url: https://git.ayabusa.dev/?a=commitdiff_plain;h=03e32e472ebd42bc26227c87042499b786687730;p=thoryum.git Error message --- diff --git a/Makefile b/Makefile index ee48c6d..262a9eb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CFLAGS = -Wall -Wextra -g LIBS = -lcurl -SRC = src/main.c src/cpu.c src/downloader.c -OBJ = build/main.o build/cpu.o build/downloader.o +SRC = src/main.c src/cpu.c src/downloader.c src/cli.c +OBJ = build/main.o build/cpu.o build/downloader.o src/cli.o RES = build/Thoryum all: setup $(OBJ) build @@ -16,10 +16,13 @@ build/cpu.o: src/cpu.c build/downloader.o: src/downloader.c $(CC) $(CFLAGS) -c $^ -o $@ $(LIBS) +build/cli.o: src/cli.c + $(CC) $(CFLAGS) -c $^ -o $@ $(LIBS) + setup: mkdir -p build -run: +run: ./$(RES) debug: diff --git a/src/cli.c b/src/cli.c new file mode 100644 index 0000000..56b8552 --- /dev/null +++ b/src/cli.c @@ -0,0 +1,32 @@ +#include "cli.h" +#include +#include + +struct ctx *init_ctx(int argc, char **argv) { + struct ctx *ctx = malloc(sizeof(struct ctx)); + +} + +void print_help() { + printf( + "Usage: thoryum [options]\n" + "Thoryum is an install helper, and update wrapper for the Thorium browser.\n" + "\n" + "Options:\n" + " -h, --help\n" + " Print this help message.\n" + "\n" + " -l, --location \n" + " Install Thorium to a specific path, default is '/usr/bin'.\n" + "\n" + " -y, --yes\n" + " Do not ask for confirmation and apply the install directly.\n" + "\n" + " -u [DO NOT USE !!!]\n" + " This is used internally to check updates for an existing install,\n" + " it should not be invoked by the user.\n" + "\n" + "For bug report or question, please send me an email at :\n" + "contact[at]ayabusa[dot]dev ;)\n" + ); +} diff --git a/src/cli.h b/src/cli.h new file mode 100644 index 0000000..4893224 --- /dev/null +++ b/src/cli.h @@ -0,0 +1,17 @@ +#ifndef CLI_H +#define CLI_H + +enum mode { + HELP, + UPDATE, + NORMAL, +}; + +struct ctx { + enum mode mode; + char *install_loc; +}; + +void print_help(); + +#endif diff --git a/src/cli.o b/src/cli.o new file mode 100644 index 0000000..48003b7 Binary files /dev/null and b/src/cli.o differ diff --git a/src/main.c b/src/main.c index 3f9f76f..62bafe9 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include #include "cpu.h" #include "downloader.h" +#include "cli.h" #define SED_PATCH "s/WMClass=thorium/WMClass=thorium-browser/g" #define DESKTOP_FILE "thorium-portable.desktop" @@ -45,5 +46,6 @@ int main() { fclose(file); */ //printf("Latest version url : '%s,'\n",DL_get_latest_version_url("AVX.zip")); - patch_desktop_file("."); + //patch_desktop_file("."); + print_help(); }