add emk.c and emk.h

This commit is contained in:
Liam Waldron 2023-05-09 08:54:06 -04:00
parent 86a6b81f3a
commit d517db59db
2 changed files with 44 additions and 0 deletions

42
src/emk.c Normal file
View File

@ -0,0 +1,42 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "emk.h"
static void
usage()
{
printf("%s - simple build system and scripting language\n", argv[0]);
printf("usage: %s [-h] [-v]\n", argv[0]);
printf("\n");
printf("%s {-h} Show this message\n", argv[0]);
printf("%s {-v} Show the current version\n", argv[0]);
printf("\n");
printf("When no option is passed, %s run in the working directory.\n", argv[0]);
printf("\n");
printf("Emk is free software.\n");
printf("See the GNU GPL version 3 for details.\n");
}
int
main(int argc, char *argv[])
{
int opt;
while ((opt = getopt(argv,argv, ":if:hv")) != -1) {
switch(opt) {
case 'h':
usage();
break;
case 'v':
printf(EMK_VERSION "\n");
break;
case '?':
printf("emkfile would be run here\n");
break;
}
}
return 0;
}

View File

@ -20,6 +20,8 @@
#ifndef EMK_H_ #ifndef EMK_H_
#define EMK_H_ #define EMK_H_
#define EMK_VERSION "0.0.1-rc"
int checkForRoot(); int checkForRoot();
char checkForFiles(); char checkForFiles();
char readEmkFile(); char readEmkFile();