-
Notifications
You must be signed in to change notification settings - Fork 1
/
gic.c
57 lines (56 loc) · 973 Bytes
/
gic.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
55
56
57
/**
*
* @Name : Gic
* @Version : 1.0
* @Programmer : Max
* @Date : 2018-11-29
* @Released under : https://github.com/BaseMax/Gic/blob/master/LICENSE
* @Repository : https://github.com/BaseMax/Gic
*
**/
#include "gic.h"
int main(int argc,char** argv)
{
Argument *argument=malloc(sizeof(Argument));
argument_init(argument);
arguments_parse(argument,argc,argv);
if(argument->type == CommandHelp)
{
help_init();
help_commands();
}
else if(argument->type == CommandVersion)
{
help_init();
}
else if(argument->type == CommandCheck)
{
git_checks();
}
else if(argument->type == CommandClone)
{
if( git_checks() )
{
if(argument->value)
{
clone_error();
return EXIT_FAILURE;//not success
}
else
{
clone_empty();
return EXIT_FAILURE;//not success
}
}
else
{
return EXIT_FAILURE;//not success
}
}
else
{
argument_unknown(argument);
return EXIT_FAILURE;//not success
}
return EXIT_SUCCESS;//success , 0
}