Move attribute lookup into the output functions. Allow a bytesperline

attribute for asm output files.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5589 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-03-10 14:22:51 +00:00
parent 2d0e71b242
commit c140a15dac
8 changed files with 69 additions and 65 deletions

View File

@@ -272,7 +272,7 @@ static void OptVersion (const char* Opt attribute ((unused)),
static void OptWrite (const char* Opt, const char* Arg)
static void OptWrite (const char* Opt attribute ((unused)), const char* Arg)
/* Write an output file */
{
static const char* NameList[] = {
@@ -283,21 +283,8 @@ static void OptWrite (const char* Opt, const char* Arg)
/* Parse the argument */
Collection* A = ParseAttrList (Arg, NameList, 2);
/* Must have a file name given */
const char* FileName = NeedAttrVal (A, "name", Opt);
/* Determine the format of the input file */
int OF = ofAuto;
const char* Format = GetAttrVal (A, "format");
if (Format != 0) {
OF = FindOutputFormat (Format);
if (OF < 0) {
Error ("Unknown output format `%s'", Format);
}
}
/* Write the file */
WriteOutputFile (FileName, D, OF);
WriteOutputFile (D, A);
/* Delete the attribute list */
FreeCollection (A);