-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
54 lines (53 loc) · 985 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <stdio.h>
#include <string.h>
#include "controller.h"
int main(int argc, char *argv[]) {
init();
if(argc == 1){
home();
}
else if(argc == 2){
if(!strcmp(argv[1], "-h")){
help();
}
else if(!strcmp(argv[1], "-playall")){
playall();
}
else{
printf("Opcao invalida\n");
}
}
else if(argc == 3){
if(!strcmp(argv[1], "-edit")){
edit_card(argv[2]);
}
else if(!strcmp(argv[1], "-del")){
del_card(argv[2]);
}
else if(!strcmp(argv[1], "-create")){
create_collection(argv[2]);
}
else if(!strcmp(argv[1], "-view")){
view_collection(argv[2]);
}
else if(!strcmp(argv[1], "-remove")){
delete_collection(argv[2]);
}
else if(!strcmp(argv[1], "-new")){
create_card(argv[2]);
}
else if(!strcmp(argv[1], "-play")){
play(argv[2]);
}
else if(!strcmp(argv[1], "-playonly")){
playonly(argv[2]);
}
else{
printf("Opcao invalida\n");
}
}
else{
printf("Quantidade de parametros invalida\n");
}
return 0;
}