From: Chris Cacciatore Date: Thu, 11 Aug 2016 23:46:48 +0000 (-0700) Subject: All programs print version and exit successfully. X-Git-Tag: V2.16~81^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F334%2Fhead;p=cc65 All programs print version and exit successfully. * All programs are now using the ProgName variable as well. --- diff --git a/src/ar65/main.c b/src/ar65/main.c index 9b9097ea4..a1839bad2 100644 --- a/src/ar65/main.c +++ b/src/ar65/main.c @@ -121,7 +121,7 @@ int main (int argc, char* argv []) break; case 'V': - fprintf (stderr, "ar65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); break; default: diff --git a/src/ca65/main.c b/src/ca65/main.c index 0016c46f3..a67319747 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -619,7 +619,8 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the assembler version */ { - fprintf (stderr, "ca65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/cc65/main.c b/src/cc65/main.c index abe2af56e..afbec43d7 100644 --- a/src/cc65/main.c +++ b/src/cc65/main.c @@ -742,7 +742,7 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the compiler version */ { - fprintf (stderr, "cc65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); exit (EXIT_SUCCESS); } diff --git a/src/chrcvt65/main.c b/src/chrcvt65/main.c index 8685e06b9..7e7183e0a 100644 --- a/src/chrcvt65/main.c +++ b/src/chrcvt65/main.c @@ -220,6 +220,7 @@ static void OptVersion (const char* Opt attribute ((unused)), { fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/cl65/main.c b/src/cl65/main.c index 654bd97b2..7bdbe7a8a 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -1233,7 +1233,8 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print version number */ { - fprintf (stderr, "cl65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/co65/main.c b/src/co65/main.c index 5e0ee2ed7..43d263516 100644 --- a/src/co65/main.c +++ b/src/co65/main.c @@ -263,7 +263,8 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the assembler version */ { - fprintf (stderr, "co65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/da65/main.c b/src/da65/main.c index 8c37e1ae2..0b0bf19e7 100644 --- a/src/da65/main.c +++ b/src/da65/main.c @@ -340,7 +340,8 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the disassembler version */ { - fprintf (stderr, "da65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/grc65/main.c b/src/grc65/main.c index 1b417c64d..2a1fef953 100644 --- a/src/grc65/main.c +++ b/src/grc65/main.c @@ -166,7 +166,8 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the program version */ { - fprintf (stderr, "grc65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/ld65/main.c b/src/ld65/main.c index 95ed14396..74511a48a 100644 --- a/src/ld65/main.c +++ b/src/ld65/main.c @@ -543,7 +543,8 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the assembler version */ { - fprintf (stderr, "ld65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/od65/main.c b/src/od65/main.c index 802290ffd..2d23f4202 100644 --- a/src/od65/main.c +++ b/src/od65/main.c @@ -209,6 +209,7 @@ static void OptVersion (const char* Opt attribute ((unused)), /* Print the assembler version */ { fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } diff --git a/src/sim65/main.c b/src/sim65/main.c index 5405af29f..f7f73165a 100644 --- a/src/sim65/main.c +++ b/src/sim65/main.c @@ -121,7 +121,8 @@ static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the simulator version */ { - fprintf (stderr, "sim65 V%s\n", GetVersionAsString ()); + fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); } static void OptQuitXIns (const char* Opt attribute ((unused)), diff --git a/src/sp65/main.c b/src/sp65/main.c index 32cc1b936..828a48fc8 100644 --- a/src/sp65/main.c +++ b/src/sp65/main.c @@ -286,6 +286,7 @@ static void OptVersion (const char* Opt attribute ((unused)), /* Print the assembler version */ { fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ()); + exit(EXIT_SUCCESS); }