1 /* Copyright 2010 Alain Knaff.
2 * This file is part of mtools.
4 * Mtools is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Mtools is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Mtools. If not, see <http://www.gnu.org/licenses/>.
18 * Change MSDOS file attribute flags
21 #include "sysincludes.h"
26 static int print_short_name(direntry_t *entry, MainParam_t *mp)
28 fprintShortPwd(stdout, entry);
34 static void usage(int ret) NORETURN;
35 static void usage(int ret)
37 fprintf(stderr, "Mtools version %s, dated %s\n",
40 "Usage: %s msdosfile [msdosfiles...]\n",
45 void mshortname(int argc, char **argv, int type)
47 struct MainParam_t mp;
50 if(helpFlag(argc, argv))
52 while ((c = getopt(argc, argv, "i:h")) != EOF) {
55 set_cmd_line_image(optarg);
72 mp.callback = print_short_name;
74 mp.lookupflags = ACCEPT_PLAIN | ACCEPT_DIR;
75 exit(main_loop(&mp, argv + optind, argc - optind));