- }
- if (argc < 3)
- goto usage;
- dest = argv[argc-1];
- if (stat(dest, &s2) >= 0 && ISDIR(s2)) {
- r = 0;
- for (i = 1; i < argc-1; i++)
- r |= movewithshortname(argv[i], dest);
+endarg: argv += optind;
+ argc -= optind;
+
+ if (argc < 2)
+ usage();
+ dest = argv[argc - 1];
+ if (stat(dest, &st) >= 0 && ISDIR(st)) {
+ for (r = 0; --argc; ++argv)
+ r |= movewithshortname(*argv, dest);