1 /* #includes */ /*{{{C}}}*//*{{{*/
18 const char cmd[]="cpmrm";
20 int main(int argc, char *argv[]) /*{{{*/
22 /* variables */ /*{{{*/
25 const char *format=FORMAT;
26 const char *devopts=NULL;
27 int c,i,usage=0,exitcode=0;
28 struct cpmSuperBlock drive;
34 /* parse options */ /*{{{*/
35 while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
37 case 'T': devopts=optarg; break;
38 case 'f': format=optarg; break;
40 case '?': usage=1; break;
43 if (optind>=(argc-1)) usage=1;
44 else image=argv[optind];
48 fprintf(stderr,"Usage: %s [-f format] [-T dsktype] image pattern ...\n",cmd);
52 /* open image */ /*{{{*/
53 if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
55 fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
58 cpmReadSuper(&drive,&root,format);
60 cpmglob(optind,argc,argv,&root,&gargc,&gargv);
61 for (i=0; i<gargc; ++i)
63 if (cpmUnlink(&root,gargv[i])==-1)
65 fprintf(stderr,"%s: can not erase %s: %s\n",cmd,gargv[i],boo);