# HG changeset patch # User lost # Date 1230856918 0 # Node ID 925105ccf22f2fb053c1760539d3904b1d26ed35 # Parent 218aabbc3b1a29a02d58efd3633f42d51473b42c small reworking of command arguments diff -r 218aabbc3b1a -r 925105ccf22f src/main.c --- a/src/main.c Thu Jan 01 23:55:18 2009 +0000 +++ b/src/main.c Fri Jan 02 00:41:58 2009 +0000 @@ -82,7 +82,22 @@ case 0x100: // proprietary object format as -> outformat = OUTPUT_OBJ; - + break; + + case 'f': + // output format + if (!strcasecmp(arg, "decb")) + as -> outformat = OUTPUT_DECB; + else if (!strcasecmp(arg, "raw")) + as -> outformat = OUTPUT_RAW; + else if (!strcasecmp(arg, "obj")) + as -> outformat = OUTPUT_OBJ; + else + { + fprintf(stderr, "Invalid output format: %s\n", arg); + exit(1); + } + break; case ARGP_KEY_END: // done; sanity check if (!as -> outfile) @@ -108,16 +123,16 @@ "Output to FILE"}, { "debug", 'd', 0, 0, "Set debug mode"}, + { "format", 'f', "TYPE", 0, + "Select output format: decb, raw, obj"}, { "list", 'l', "FILE", OPTION_ARG_OPTIONAL, "Generate list [to FILE]"}, { "decb", 'b', 0, 0, - "Generate DECB .bin format output"}, + "Generate DECB .bin format output, equivalent of --format=decb"}, { "raw", 'r', 0, 0, - "Generate raw binary format output"}, - { "rawrel", 0, 0, 0, - "Generate raw binary respecing ORG statements as offsets from the start of the file"}, + "Generate raw binary format output, equivalent of --format=raw"}, { "obj", 0, 0, 0, - "Generate proprietary object file format for later linking" }, + "Generate proprietary object file format for later linking, equivalent of --format=obj" }, { 0 } }; @@ -140,6 +155,12 @@ if (!asmstate.listfile) asmstate.listfile = "-"; + if (!asmstate.infile) + { + fprintf(stderr, "No input files specified.\n"); + exit(1); + } + /* pass 1 - collect the symbols and assign addresses where possible */ /* pass 1 also resolves included files, etc. */ /* that means files are read exactly once unless included multiple times */