forked from xelaka/commandLinux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
53 lines (41 loc) · 1.33 KB
/
Copy pathmain.c
File metadata and controls
53 lines (41 loc) · 1.33 KB
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
#include "my_lib.h"
int main(int argc, char** argv){
int i = 1;
OPTIONS op;
op.arg_no_options = TRUE; //Default
op.arg_same = FALSE; //File are the same (-s & --report-identical-files)
op.arg_differ = FALSE; //File are differents (-q & --brief)
op.arg_help = FALSE; //Display help message
/*
A Faire
-i & --ignore-case //ignore la case
--ignore-file-name-case //ignore la case dans LE NOM des fichiers
--no-ignore-file-name-case //n'ignore pas la case dans LE NOM des fichiers
-E --ignore-tab-expension //ignore les tabulations
-b --ignore-space-change //ignore le nombre d'espace
-w --ignore-all-space //ignore tous les espaces
-B --ignore-blank-lines //ignore les lignes vides
*/
for(i = 1; i < argc; i++){
if(!my_strcmp(argv[i], "--normal"))
op.arg_no_options = TRUE;
if(!my_strcmp(argv[i], "-q") || !my_strcmp(argv[i], "--brief")){
op.arg_no_options = FALSE;
op.arg_differ = TRUE;
}
if(!my_strcmp(argv[i], "-s") || !my_strcmp(argv[i], "--report-identical-files")){
op.arg_no_options = FALSE;
op.arg_same = TRUE;
}
if(!my_strcmp(argv[i], "--help"))
op.arg_help = TRUE;
//if(!my_strcmp(argv[i], "-a"))
}
if(op.arg_help){
help();
return 1;
}
//Test
//op.arg_no_options? printf("arg_no_options ENABLED\n") : printf("arg_no_options DISABLED");
return 0;
}