started working on argv parsing
This commit is contained in:
parent
86a1552530
commit
d61c7f8dcd
|
@ -51,6 +51,14 @@ int stringtoint(char number[], int length){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int stringlength(char string[]){
|
||||||
|
int i = 0;
|
||||||
|
while(string[i]!='\0'){
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv){
|
int main(int argc, char** argv){
|
||||||
if (argc == 1 || comparestrings(argv[1], "-h") == 0
|
if (argc == 1 || comparestrings(argv[1], "-h") == 0
|
||||||
|| comparestrings(argv[1], "--help") == 0){
|
|| comparestrings(argv[1], "--help") == 0){
|
||||||
|
@ -64,6 +72,8 @@ int main(int argc, char** argv){
|
||||||
printf(" see homemade_speedstep --help\n");
|
printf(" see homemade_speedstep --help\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
int maxtemp = stringtoint(argv[1], stringlength(argv[1]));
|
||||||
|
int mintemp = stringtoint(argv[2], stringlength(argv[2]));
|
||||||
char gov[20];
|
char gov[20];
|
||||||
FILE *govfile = fopen(CURGOV, "r");
|
FILE *govfile = fopen(CURGOV, "r");
|
||||||
getfilec(govfile, gov);
|
getfilec(govfile, gov);
|
||||||
|
|
Loading…
Reference in New Issue