There are no available options for this view.

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by stacktic, Fri Aug 1 10:42:03 2008 UTC revision 1.3 by stacktic, Mon Sep 8 12:24:09 2008 UTC
# Line 31  Line 31 
31  #include <err.h>  #include <err.h>
32  #include <getopt.h>  #include <getopt.h>
33  #include <stdio.h>  #include <stdio.h>
34    #include <stdlib.h>
35  #include <string.h>  #include <string.h>
36    
37  #include <rump/ukfs.h>  #include <rump/ukfs.h>
# Line 41  Line 42 
42  static int is_user_ok(const char *);  static int is_user_ok(const char *);
43  static int move_to_dir(struct ukfs *, const char *, const char *, int);  static int move_to_dir(struct ukfs *, const char *, const char *, int);
44  static int move_to_file(struct ukfs *, const char *, const char *, int);  static int move_to_file(struct ukfs *, const char *, const char *, int);
45    static void usage(void);
46    
47    static char *progname;
48    
49  int  int
50  fsu_mv_main(struct ukfs *fs, int argc, char *argv[])  fsu_mv_main(struct ukfs *fs, int argc, char *argv[])
51  {  {
52          int cur_arg, flags = 0, rv;          int cur_arg, flags = 0, rv;
53    
54            progname = argv[0];
55    
56          flags = fsu_mv_parse_arg(&argc, &argv);          flags = fsu_mv_parse_arg(&argc, &argv);
57          if (flags == -1 || argc < 2) {          if (flags == -1 || argc < 2) {
58                  fprintf(stderr, "usage: \tmv [-iv] source target\n"                  usage();
                         "\tmv [-iv] source ... directory\n");  
59                  return -1;                  return -1;
60          }          }
61    
# Line 186  Line 191 
191          }          }
192          return 0;          return 0;
193  }  }
194    
195    static void
196    usage(void)
197    {
198    
199    #ifdef FSU_CONSOLE
200            fprintf(stderr, "usage: \t%s [-iv] source target\n"
201                    "\t%s [-iv] source ... directory\n",
202                    progname, progname);
203    #else
204            fprintf(stderr,
205       "usage: \t%s [MNT_OPTIONS] [fstype] fsdevice [-iv] source target\n"
206       "       \t%s [MNT_OPTIONS] [fstype] fsdevice [-iv] source ... directory\n",
207                    getprogname(), getprogname());
208            exit(EXIT_FAILURE);
209    #endif
210    }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3