add actions
This commit is contained in:
parent
04e2a70315
commit
3bb222a532
6 changed files with 40 additions and 1 deletions
9
objs.mk
9
objs.mk
|
|
@ -14,6 +14,15 @@ src/external_xemil_src_unicode.o: external/xemil/src/unicode.c
|
|||
OBJS += src/external_xemil_src_util.o
|
||||
src/external_xemil_src_util.o: external/xemil/src/util.c
|
||||
$(CC) $(CFLAGS) -c -o $@ external/xemil/src/util.c
|
||||
OBJS += src/src_help.o
|
||||
src/src_help.o: src/help.c
|
||||
$(CC) $(CFLAGS) -c -o $@ src/help.c
|
||||
OBJS += src/src_main.o
|
||||
src/src_main.o: src/main.c
|
||||
$(CC) $(CFLAGS) -c -o $@ src/main.c
|
||||
OBJS += src/src_seed.o
|
||||
src/src_seed.o: src/seed.c
|
||||
$(CC) $(CFLAGS) -c -o $@ src/seed.c
|
||||
OBJS += src/src_site.o
|
||||
src/src_site.o: src/site.c
|
||||
$(CC) $(CFLAGS) -c -o $@ src/site.c
|
||||
|
|
|
|||
9
src/help.c
Normal file
9
src/help.c
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include <taiga.h>
|
||||
|
||||
int action_help(int argc, char** argv){
|
||||
printf("Actions:\n");
|
||||
printf(" help Show this help\n");
|
||||
printf(" seed Creates a new website\n");
|
||||
printf(" site Builds an website (default action)\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
int main(int argc, char** argv){
|
||||
int i;
|
||||
char* action;
|
||||
char* action = NULL;
|
||||
int target_argc = 0;
|
||||
char** target_argv = malloc(sizeof(*target_argv));
|
||||
target_argv[0] = NULL;
|
||||
|
|
@ -26,6 +26,10 @@ int main(int argc, char** argv){
|
|||
|
||||
if(strcmp(action, "site") == 0){
|
||||
return action_site(target_argc, target_argv);
|
||||
}else if(strcmp(action, "help") == 0){
|
||||
return action_help(target_argc, target_argv);
|
||||
}else if(strcmp(action, "seed") == 0){
|
||||
return action_seed(target_argc, target_argv);
|
||||
}
|
||||
|
||||
fprintf(stderr, "Unknown action\n");
|
||||
|
|
|
|||
5
src/seed.c
Normal file
5
src/seed.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include <taiga.h>
|
||||
|
||||
int action_seed(int argc, char** argv){
|
||||
return 0;
|
||||
}
|
||||
5
src/site.c
Normal file
5
src/site.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include <taiga.h>
|
||||
|
||||
int action_site(int argc, char** argv){
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -5,6 +5,13 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* site.c */
|
||||
int action_site(int argc, char** argv);
|
||||
|
||||
/* help.c */
|
||||
int action_help(int argc, char** argv);
|
||||
|
||||
/* seed.c */
|
||||
int action_seed(int argc, char** argv);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue