]> git.draconx.ca Git - gob-dx.git/blobdiff - src/main.c
Expand --no-touch-headers to include the private header.
[gob-dx.git] / src / main.c
index 60c128aac53e8cae755deccd9c220df0d9a23546..81b22f1452220c3b8d7eb46d137337c71776bf89 100644 (file)
@@ -3492,13 +3492,13 @@ open_files(void)
                if (file_sep != 0)
                        sep[0] = file_sep;
                outfilephbase = g_strconcat (fullfilebase, sep, "private.h", NULL);
-               outfileph = g_strconcat (outfilephbase, no_touch ? "#gob#" : "", NULL);
+               outfileph = g_strconcat (outfilephbase, no_touch_headers ? "#gob#" : "", NULL);
        } else {
                outfilephbase = NULL;
                outfileph = NULL;
        }
 
-       
+
        if ( ! no_write) {
                out = fopen (outfile, "w");
                if (out == NULL) {
@@ -4520,6 +4520,18 @@ generate_outfiles(void)
        print_header_postfixes();
 }
 
+static void print_version(void)
+{
+       printf("%s (%s) %s\n", PACKAGE_NAME, PACKAGE_TARNAME, PACKAGE_VERSION);
+       putchar('\n');
+       puts("Copyright (C) 2013 George (Jiri) Lebl et al.");
+       puts("Copyright (C) 2020 Nick Bowler");
+       puts("License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl.html>.");
+       puts("This is free software: you are free to change and redistribute it.");
+       puts("There is NO WARRANTY, to the extent permitted by law.");
+
+}
+
 static void print_usage(FILE *f)
 {
        fprintf(f, "Usage: %s [options] file.gob\n", g_get_prgname());
@@ -4644,7 +4656,7 @@ parse_options(int argc, char *argv[])
                        print_help();
                        exit(0);
                } else if(strcmp(argv[i], "--version")==0) {
-                       fprintf(stderr, "Gob version %s\n", VERSION);
+                       print_version();
                        exit(0);
                } else if(strcmp(argv[i], "--exit-on-warn")==0) {
                        exit_on_warn = TRUE;
@@ -4952,15 +4964,16 @@ main(int argc, char *argv[])
        if (outph)
                fclose (outph);
 
-       if (! no_write) {
+       if (!no_write) {
                if (no_touch) {
-                       compare_and_move (outfilebase);
+                       compare_and_move(outfilebase);
+               }
+               if (no_touch_headers) {
+                       compare_and_move(outfilehbase);
                        if (outfilephbase)
-                               compare_and_move (outfilephbase);
+                               compare_and_move(outfilephbase);
                }
-               if (no_touch_headers)
-                       compare_and_move (outfilehbase);
        }
-       
+
        return 0;
 }