diff --git a/src/ln.c b/src/ln.c index b34ac02..34763ae 100644 --- a/src/ln.c +++ b/src/ln.c @@ -6,11 +6,21 @@ int main(int argc, char *argv[]) { + if(argc == 1) { printf("Usage: ln oldfile newfile\n"); return 1; } + + int c = getopt(argc, argv, "s"); + if(c == 's') + { + symlink(argv[2],argv[3]); + return 0; + } + + int fd = link(argv[1],argv[2]); if(fd == -1) {