This repository has been archived on 2025-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
Breeze/main.c
2025-04-01 20:57:33 +02:00

56 lines
1.1 KiB
C

#include <stdio.h>
#include <string.h>
#include "func.h"
#include "config/config.h"
char *defaultOptions[]={"help","add","run","del","rm"};
void addCmd(char ** str);
void delCmd(char ** str);
void runCmd(char ** str);
int main(int argc, char *argv[]) {
if (argc<2) {
printHelp();
return 0;
}
int choice = whichOption(defaultOptions,argv[1]);
switch (choice) {
case 0:
printHelp();
return 0;
case 1: // add
addCmd(&argv[2]);
return 0;
case 2: // run
runCmd(&argv[2]);
return 0;
case 3:
case 4: {
delCmd(&argv[2]);
return 0;
}
default: ;
}
loadConfig("config.json");
return 0;
}
void addCmd(char ** str) { //TODO: implement
int i=0;
while (*(str+i)) {
printf("adding %s \n", *(str+i));
i++;
}
}
void delCmd(char ** str) { //TODO: implement
printf("removed %s \n", *str);
}
void runCmd(char ** str) { //TODO: implement
printf("running %s \n", *str);
}