33 lines
531 B
C
33 lines
531 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
|
|
//TODO
|
|
int main(const int argc, const char **argv) {
|
|
unsigned int r_flag = 0;
|
|
unsigned int s_flag = 0;
|
|
|
|
int i;
|
|
for (i = 1; i < argc; i++) {
|
|
if (argv[i][0] != '-')
|
|
break;
|
|
|
|
else if (!strcmp(argv[i], "-r"))
|
|
r_flag = 1;
|
|
|
|
else if (!strcmp(argv[i], "-s"))
|
|
s_flag = 1;
|
|
|
|
else if (!strcmp(argv[i], "--help")) {
|
|
printf("chmod [-r (recursive)] [-s (silent)] [file1 file2...]\n");
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
|