1 /* #includes */ /*{{{C}}}*//*{{{*/
12 const char cmd[]="cpmrm";
14 int main(int argc, char *argv[]) /*{{{*/
16 /* variables */ /*{{{*/
19 const char *format=FORMAT;
20 const char *devopts=NULL;
21 int c,i,usage=0,exitcode=0;
22 struct cpmSuperBlock drive;
28 /* parse options */ /*{{{*/
29 while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
31 case 'T': devopts=optarg; break;
32 case 'f': format=optarg; break;
34 case '?': usage=1; break;
37 if (optind>=(argc-1)) usage=1;
38 else image=argv[optind];
42 fprintf(stderr,"Usage: %s [-f format] [-T dsktype] image pattern ...\n",cmd);
46 /* open image */ /*{{{*/
47 if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
49 fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
52 cpmReadSuper(&drive,&root,format);
54 cpmglob(optind,argc,argv,&root,&gargc,&gargv);
55 for (i=0; i<gargc; ++i)
57 if (cpmUnlink(&root,gargv[i])==-1)
59 fprintf(stderr,"%s: can not erase %s: %s\n",cmd,gargv[i],boo);