return res;
}
+static int
+execLink(int argc, char *argv[])
+{
+ int res = EXIT_SUCCESS;
+
+ if (argc!=3) {
+ WRITE_MSG(2, "Need exactly two files for 'link' operation; try '--help' for more information\n");
+ return wrapper_exit_code;
+ }
+
+ if (symlink(argv[1], argv[2])==-1) {
+ PERROR_Q(ENSC_WRAPPERS_PREFIX "link", argv[1]);
+ res = EXIT_FAILURE;
+ }
+
+ return res;
+}
+
static struct Command {
char const *cmd;
int (*handler)(int argc, char *argv[]);
{ "rm", execRm },
{ "mkdir", execMkdir },
{ "chmod", execChmod },
+ { "link", execLink },
{ 0,0 }
};
" rm <file>+ ... unlink the given files\n"
" mkdir <file>+ ... create the given directories\n"
" chmod <mode> <file>+\n"
- " ... change access permissions of files\n\n"
+ " ... change access permissions of files\n"
+ " link <src> dst> ... create a symbolic link from <src> to <dst>\n\n"
"Please report bugs to " PACKAGE_BUGREPORT "\n");
exit(0);
}