diff --git a/Makefile.vars b/Makefile.vars index e61d4eb..efb2d10 100755 --- a/Makefile.vars +++ b/Makefile.vars @@ -64,7 +64,7 @@ endif # - More flags (profiling, ...) #CMOREFLAGS := # - All C Compiler flags - CFLAGS := $(CWARN) -std=gnu11 -O2 -D VERSION="$(VERSION)" \ + CFLAGS := $(CWARN) -std=gnu11 -O2 -D NAME="$(NAME)" -D VERSION="$(VERSION)" \ -D MAINTAINER="$(MAINTAINER_NAME) <$(MAINTAINER_MAIL)>" \ -D DEFAULT_STORAGE="$(DEFAULT_STORAGE)" \ -D DEFAULT_ZOOM="$(DEFAULT_ZOOM)" \ diff --git a/src/p7/args.c b/src/p7/args.c index 0aac282..8de2362 100644 --- a/src/p7/args.c +++ b/src/p7/args.c @@ -19,7 +19,7 @@ /* ************************************************************************** */ /* Version message */ static const char version_message[] = -QUOTE(BIN) " - from p7utils v" QUOTE(VERSION) " (licensed under GPLv2)\n" +QUOTE(BIN) " - from " QUOTE(NAME) " v" QUOTE(VERSION) " (licensed under GPLv2)\n" "Maintained by " QUOTE(MAINTAINER) ".\n" "\n" "This is free software; see the source for copying conditions.\n" diff --git a/src/p7/main.c b/src/p7/main.c index 5a60edd..a3a2e9a 100644 --- a/src/p7/main.c +++ b/src/p7/main.c @@ -44,7 +44,8 @@ static const char error_unsupported_device[] = /* The calculator acted in an unplanned way. */ static const char error_unplanned[] = "The calculator didn't act as planned.\n" -"Stop receive mode on calculator and start it again before re-running p7.\n" +"Stop receive mode on calculator and start it again before re-running " \ + QUOTE(BIN) ".\n" "Error was: %s\n"; /* Requested file didn't exist. */ diff --git a/src/p7os/args.c b/src/p7os/args.c index 5f2f802..857cf69 100644 --- a/src/p7os/args.c +++ b/src/p7os/args.c @@ -18,7 +18,7 @@ /* ************************************************************************** */ /* The version message - that's when the President comes in */ static const char version_message[] = -"p7os - from p7utils v" QUOTE(VERSION) " (licensed under GPLv2)\n" +QUOTE(BIN) " - from " QUOTE(NAME) " v" QUOTE(VERSION) " (licensed under GPLv2)\n" "Maintained by " QUOTE(MAINTAINER) ".\n" "\n" "This is free software; see the source for copying conditions.\n" @@ -27,7 +27,7 @@ static const char version_message[] = /* Main help message */ static const char help_main[] = -"Usage: p7os [--version|-v] [--help|-h] [--device /dev/omg0]\n" +"Usage: " QUOTE(BIN) " [--version|-v] [--help|-h] [--device /dev/omg0]\n" " [options...]\n" "\n" "Subcommands you can use are :\n" @@ -43,16 +43,19 @@ static const char help_main[] = " --device dev The calculator device (usually /dev/ttyUSBx).\n" " By default, will use the first appropriate device found.\n" "\n" -"Type \"p7os --help\" for some help about a subcommand.\n" +"Type \"" QUOTE(BIN) " --help\" for some help about a subcommand.\n" "Report bugs to " QUOTE(MAINTAINER) "."; +/* Subcommands help messages footer */ +#define FOOT \ + "\nType \"" QUOTE(BIN) " --help\" for other subcommands and general options." + /* Help message for prepare subcommand */ static const char help_prepare[] = "Usage: p7os prepare\n" "Send the P7 server on the calculator for further operations.\n" "This must be used before any other p7os operation.\n" -"\n" -"Type \"p7os --help\" for other subcommands and general options."; +FOOT; /* Help message for get subcommand */ static const char help_get[] = @@ -62,8 +65,7 @@ static const char help_get[] = "\n" "Options are :\n" " -o Where to store the image (default is \"os.bin\")\n" -"\n" -"Type \"p7os --help\" for other subcommands and general options."; +FOOT; /* ************************************************************************** */ /* Main function */ diff --git a/src/p7os/main.c b/src/p7os/main.c index 8d10e46..aaa8658 100644 --- a/src/p7os/main.c +++ b/src/p7os/main.c @@ -27,7 +27,8 @@ const char error_noaccess[] = /* The calculator acted in a weird way. */ const char error_unplanned[] = "The calculator didn't act as planned: %s.\n" -"Stop receive mode on calculator and start it again before re-running p7os.\n"; +"Stop receive mode on calculator and start it again before re-running " \ + QUOTE(BIN) ".\n"; /* Unsupported operation -> OS Update, not receive mode! */ const char error_unsupported[] = diff --git a/src/p7screen/args.c b/src/p7screen/args.c index 1012b0f..64aa935 100644 --- a/src/p7screen/args.c +++ b/src/p7screen/args.c @@ -16,7 +16,7 @@ /* ************************************************************************** */ /* Version message */ static const char version_message[] = -"p7screen - from p7utils v" QUOTE(VERSION) " (licensed under GPLv2)\n" +QUOTE(BIN) " - from " QUOTE(NAME) " v" QUOTE(VERSION) " (licensed under GPLv2)\n" "Maintained by " QUOTE(MAINTAINER) ".\n" "\n" "This is free software; see the source for copying conditions.\n" @@ -25,7 +25,7 @@ static const char version_message[] = /* Help message */ static const char help_main[] = -"Usage: p7screen [--help|-h] [--version|-v]\n" +"Usage: " QUOTE(BIN) " [--help|-h] [--version|-v]\n" " [--device /dev/omg0]\n" "\n" "Displays the streamed screen from a CASIO fx calculator.\n" diff --git a/src/p7screen/main.c b/src/p7screen/main.c index cc6d2be..2783b41 100644 --- a/src/p7screen/main.c +++ b/src/p7screen/main.c @@ -30,7 +30,8 @@ static const char error_noaccess[] = /* The calculator acted in a weird way. */ static const char error_unplanned[] = "The calculator didn't act as planned.\n" -"Stop receive mode on calculator and start it again before re-running p7screen.\n" +"Stop receive mode on calculator and start it again before re-running " \ + QUOTE(BIN) ".\n" "Error was: %s\n"; /* ************************************************************************** */