Add dumping of options
git-svn-id: svn://svn.cc65.org/cc65/trunk@237 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -77,7 +77,8 @@ static void Usage (void)
|
||||
" -V\t\t\tPrint the version number and exit\n"
|
||||
"\n"
|
||||
"Long options:\n"
|
||||
" --dump-header\t\tDump the object file header\n"
|
||||
" --dump-header\t\tDump the object file header\n"
|
||||
" --dump-options\t\tDump object file options\n"
|
||||
" --help\t\tHelp (this text)\n"
|
||||
" --version\t\tPrint the version number and exit\n",
|
||||
ProgName);
|
||||
@@ -93,6 +94,14 @@ static void OptDumpHeader (const char* Opt, const char* Arg)
|
||||
|
||||
|
||||
|
||||
static void OptDumpOptions (const char* Opt, const char* Arg)
|
||||
/* Dump the object file options */
|
||||
{
|
||||
What |= D_OPTIONS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void OptHelp (const char* Opt, const char* Arg)
|
||||
/* Print usage information and exit */
|
||||
{
|
||||
@@ -130,7 +139,7 @@ static void DumpFile (const char* Name)
|
||||
if (Magic != OBJ_MAGIC) {
|
||||
|
||||
/* Unknown format */
|
||||
printf ("%s: (no xo65 object file)\n", Name);
|
||||
printf ("%s: (no x65 object file)\n", Name);
|
||||
|
||||
} else if (What == 0) {
|
||||
|
||||
@@ -144,9 +153,11 @@ static void DumpFile (const char* Name)
|
||||
|
||||
/* Check what to dump */
|
||||
if (What & D_HEADER) {
|
||||
DumpHeader (F, 0);
|
||||
DumpObjHeader (F, 0);
|
||||
}
|
||||
|
||||
if (What & D_OPTIONS) {
|
||||
DumpObjOptions (F, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Close the file */
|
||||
@@ -161,6 +172,7 @@ int main (int argc, char* argv [])
|
||||
/* Program long options */
|
||||
static const LongOpt OptTab[] = {
|
||||
{ "--dump-header", 0, OptDumpHeader },
|
||||
{ "--dump-options", 0, OptDumpOptions },
|
||||
{ "--help", 0, OptHelp },
|
||||
{ "--version", 0, OptVersion },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user