-static const char ln_usage[] =
- "ln [OPTION] TARGET... LINK_NAME|DIRECTORY\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
- "\nCreate a link named LINK_NAME or DIRECTORY to the specified TARGET\n"
- "\nYou may use '--' to indicate that all following arguments are non-options.\n\n"
- "Options:\n"
- "\t-s\tmake symbolic links instead of hard links\n"
-
- "\t-f\tremove existing destination files\n"
-#if 0
- "\t-n\tno dereference symlinks - treat like normal file\n"
-#endif
-#endif
- ;
-
-static int symlinkFlag = FALSE;
-static int removeoldFlag = FALSE;
-static int followLinks = TRUE;
-
-extern int ln_main(int argc, char **argv)
-{
- char *linkName, *dirName=NULL;
- int linkIntoDirFlag;
- int stopIt = FALSE;
-
- argc--;
- argv++;
-
- /* Parse any options */
- while (argc > 0 && stopIt == FALSE) {
- if (**argv == '-') {
- while (*++(*argv))
- switch (**argv) {
- case 's':
- symlinkFlag = TRUE;
- break;
- case 'f':
- removeoldFlag = TRUE;
- break;
- case 'n':
- followLinks = FALSE;
- break;
- case '-':
- stopIt = TRUE;
- break;
- default:
- usage(ln_usage);
- }
- argc--;
- argv++;
- }
- else
- break;
- }