actually, delete usage function
This commit is contained in:
parent
13eb71f4ee
commit
2009c18381
13
ww.c
13
ww.c
|
@ -31,17 +31,9 @@ int process_fn(int fn)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void usage(){
|
||||
printf("Usage: ww file.txt\n");
|
||||
printf(" or: cat file.txt | ww\n");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'h'){
|
||||
usage();
|
||||
return 0;
|
||||
} else if (!isatty(STDIN_FILENO)) {
|
||||
if (!isatty(STDIN_FILENO)) {
|
||||
return process_fn(STDIN_FILENO);
|
||||
} else if (argc > 1) {
|
||||
FILE* fp = fopen(argv[1], "r");
|
||||
|
@ -51,7 +43,8 @@ int main(int argc, char** argv)
|
|||
}
|
||||
return process_fn(fileno(fp));
|
||||
} else {
|
||||
usage();
|
||||
printf("Usage: ww file.txt\n");
|
||||
printf(" or: cat file.txt | ww\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user