A program's version text, when requested by the user, is not an error
message. Kind of silly to direct it to the standard error stream.
Adjust the program so that version text goes to standard output, and
format the message to be consistent with the GNU coding standards.
dnl This is free software: you are free to change and redistribute it.
dnl There is NO WARRANTY, to the extent permitted by law.
dnl This is free software: you are free to change and redistribute it.
dnl There is NO WARRANTY, to the extent permitted by law.
-AC_INIT([gob-dx], [2.0.20a], [nbowler@draconx.ca])
+AC_INIT([GObject Builder], [2.0.20a], [nbowler@draconx.ca], [gob-dx])
AC_CONFIG_SRCDIR([src/treefuncs.def])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/treefuncs.def])
AC_CONFIG_HEADERS([config.h])
print_header_postfixes();
}
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());
static void print_usage(FILE *f)
{
fprintf(f, "Usage: %s [options] file.gob\n", g_get_prgname());
print_help();
exit(0);
} else if(strcmp(argv[i], "--version")==0) {
print_help();
exit(0);
} else if(strcmp(argv[i], "--version")==0) {
- fprintf(stderr, "Gob version %s\n", VERSION);
exit(0);
} else if(strcmp(argv[i], "--exit-on-warn")==0) {
exit_on_warn = TRUE;
exit(0);
} else if(strcmp(argv[i], "--exit-on-warn")==0) {
exit_on_warn = TRUE;
AT_SETUP([--version option])
AT_KEYWORDS([option])dnl
AT_SETUP([--version option])
AT_KEYWORDS([option])dnl
-# Currently prints to standard error :(
-AT_XFAIL_IF([:])
AT_CHECK([gob2 invalid-file.gob --version --invalid-option], [0], [stdout])
AT_CHECK([awk 'NR == 1 { print $NF }' stdout], [0], [AT_PACKAGE_VERSION
])
AT_CHECK([gob2 invalid-file.gob --version --invalid-option], [0], [stdout])
AT_CHECK([awk 'NR == 1 { print $NF }' stdout], [0], [AT_PACKAGE_VERSION
])