From 01bdac290775e077a5be3a830b6a026897300e72 Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 23 Aug 2000 14:16:16 +0000 Subject: [PATCH] Remove checks for an argument in the option handling functions, since the check is done by the cmdline module. git-svn-id: svn://svn.cc65.org/cc65/trunk@303 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cl65/main.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/cl65/main.c b/src/cl65/main.c index 12dac5da7..bf7f89442 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -561,6 +561,7 @@ static void Usage (void) " --debug-info\t\tAdd debug info\n" " --help\t\tHelp (this text)\n" " --include-dir dir\tSet a compiler include directory path\n" + " --mapfile name\tCreate a map file\n" " --target sys\t\tSet the target system\n" " --version\t\tPrint the version number\n" " --verbose\t\tVerbose mode\n", @@ -580,9 +581,6 @@ static void OptAnsi (const char* Opt, const char* Arg) static void OptAsmIncludeDir (const char* Opt, const char* Arg) /* Include directory (assembler) */ { - if (Arg == 0) { - NeedArg (Opt); - } CmdAddArg (&CA65, "-I"); CmdAddArg (&CA65, Arg); } @@ -618,21 +616,25 @@ static void OptHelp (const char* Opt, const char* Arg) static void OptIncludeDir (const char* Opt, const char* Arg) /* Include directory (compiler) */ { - if (Arg == 0) { - NeedArg (Opt); - } CmdAddArg (&CC65, "-I"); CmdAddArg (&CC65, Arg); } +static void OptMapFile (const char* Opt, const char* Arg) +/* Create a map file */ +{ + /* Create a map file (linker) */ + CmdAddArg (&LD65, "-m"); + CmdAddArg (&LD65, Arg); +} + + + static void OptTarget (const char* Opt, const char* Arg) /* Set the target system */ { - if (Arg == 0) { - NeedArg (Opt); - } Target = FindTarget (Arg); if (Target == TGT_UNKNOWN) { Error ("No such target system: `%s'", Arg); @@ -672,6 +674,7 @@ int main (int argc, char* argv []) { "--debug-info", 0, OptDebugInfo }, { "--help", 0, OptHelp }, { "--include-dir", 1, OptIncludeDir }, + { "--mapfile", 1, OptMapFile }, { "--target", 1, OptTarget }, { "--verbose", 0, OptVerbose }, { "--version", 0, OptVersion }, @@ -793,8 +796,7 @@ int main (int argc, char* argv []) case 'm': /* Create a map file (linker) */ - CmdAddArg (&LD65, "-m"); - CmdAddArg (&LD65, GetArg (&I, 2)); + OptMapFile (Arg, GetArg (&I, 2)); break; case 'o': -- 2.39.5