-main(argc, argv)
- int argc;
- char **argv;
-{
- PLAN *plan;
- char **p, **paths;
- PLAN *find_formplan();
- time_t time();
- void newsyntax(), oldsyntax();
-
- (void)time(&now); /* initialize the time-of-day */
-
- if (argc < 2)
- usage();
-
- paths = argv;
-
- /*
- * if arguments start with an option, treat it like new syntax;
- * otherwise, if has a "-option" anywhere (which isn't an argument
- * to another command) treat it as old syntax.
- */
- if (argv[1][0] != '-')
- for (p = argv + 1; *p; ++p) {
- if (!strcmp(*p, "exec") || !strcmp(*p, "ok")) {
- while (p[1] && strcmp(*++p, ";"));
- continue;
- }
- if (**p == '-') {
- isdeprecated = 1;
- oldsyntax(&argv);
- break;
- }
- }
- if (!isdeprecated)
- newsyntax(argc, &argv);
-
- plan = find_formplan(argv); /* execution plan */
- find_execute(plan, paths);
-}