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
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:
--- /dev/null
+#include "cli.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+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 <path>\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"
+ );
+}
#include <sys/wait.h>
#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"
fclose(file);
*/
//printf("Latest version url : '%s,'\n",DL_get_latest_version_url("AVX.zip"));
- patch_desktop_file(".");
+ //patch_desktop_file(".");
+ print_help();
}