int main(int argc, char *argv[]) { section *s; if(argc < 3){ fprintf(stderr,"usage: %s <inifile> <bootfile>\n",argv[0]); return 1; } if((argc > 3) && !strcmp(argv[3],"-floppy")){ make_floppy = 1; } if(s = load_ini(argv[1])){ makeboot(s,argv[2]); } else { fprintf(stderr,"error: can't read %s\n",argv[1]); } return 0; }
int main(int argc, char **argv) { char *file = NULL; section *s; if(argc < 2){ usage: fprintf(stderr,"usage: %s [--littleendian (default)] [--bigendian ] [ --strip-binary <binary ] [ --strip-debug] [ --sparc | -s ] [ <inifile> ... ] -o <bootfile>\n",argv[0]); return 1; } argc--; argv++; while(argc){ if(!strcmp(*argv,"--sparc")) { make_sparcboot = 1; } else if(!strcmp(*argv, "--bigendian")) { target_endian = BE; } else if(!strcmp(*argv,"-o")) { argc--; argv++; if(argc) { file = *argv; } else { goto usage; } } else if(!strcmp(*argv, "--strip-binary")) { argc--; argv++; if(argc) { strip_binary = *argv; } else { goto usage; } } else if(!strcmp(*argv, "--strip-debug")) { strip_debug = 1; } else { if(load_ini(*argv) == NULL) { fprintf(stderr,"warning: cannot load '%s'\n",*argv); } } argc--; argv++; } if((argc > 3) && !strcmp(argv[3],"-sparc")){ make_sparcboot = 1; } if(!file){ fprintf(stderr,"error: no output specified\n"); goto usage; } if(!first){ fprintf(stderr,"error: no data to write?!\n"); goto usage; } makeboot(first,file); return 0; }