add emk.c and emk.h
This commit is contained in:
parent
86a6b81f3a
commit
d517db59db
42
src/emk.c
Normal file
42
src/emk.c
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user