diff options
| author | David M. Syzdek <david@syzdek.net> | 2021-10-11 12:10:05 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2021-10-11 12:10:05 -0800 |
| commit | f9b37e10f2f441f8e46777107c1a6abbfe74cf6e (patch) | |
| tree | a1a7b04d4b8261efb738f616a71b78ab0ac1e33f | |
| parent | 214238d21eeecda83db6130e23d50880f53da8ac (diff) | |
| download | dmstools-f9b37e10f2f441f8e46777107c1a6abbfe74cf6e.tar.gz dmstools-f9b37e10f2f441f8e46777107c1a6abbfe74cf6e.tar.bz2 dmstools-f9b37e10f2f441f8e46777107c1a6abbfe74cf6e.tar.xz dmstools-f9b37e10f2f441f8e46777107c1a6abbfe74cf6e.zip | |
colors: removing i18l support
| -rw-r--r-- | src/colors.c | 64 |
1 files changed, 15 insertions, 49 deletions
diff --git a/src/colors.c b/src/colors.c index 06cbacb..1e3b7f7 100644 --- a/src/colors.c +++ b/src/colors.c | |||
| @@ -67,26 +67,6 @@ | |||
| 67 | 67 | ||
| 68 | /////////////////// | 68 | /////////////////// |
| 69 | // // | 69 | // // |
| 70 | // i18l Support // | ||
| 71 | // // | ||
| 72 | /////////////////// | ||
| 73 | |||
| 74 | #ifdef HAVE_GETTEXT | ||
| 75 | # include <gettext.h> | ||
| 76 | # include <libintl.h> | ||
| 77 | # define _(String) gettext (String) | ||
| 78 | # define gettext_noop(String) String | ||
| 79 | # define N_(String) gettext_noop (String) | ||
| 80 | #else | ||
| 81 | # define _(String) (String) | ||
| 82 | # define N_(String) String | ||
| 83 | # define textdomain(Domain) | ||
| 84 | # define bindtextdomain(Package, Directory) | ||
| 85 | #endif | ||
| 86 | |||
| 87 | |||
| 88 | /////////////////// | ||
| 89 | // // | ||
| 90 | // Definitions // | 70 | // Definitions // |
| 91 | // // | 71 | // // |
| 92 | /////////////////// | 72 | /////////////////// |
| @@ -137,18 +117,12 @@ int main PARAMS((int argc, char * argv[])); | |||
| 137 | /// displays usage | 117 | /// displays usage |
| 138 | void colors_usage(void) | 118 | void colors_usage(void) |
| 139 | { | 119 | { |
| 140 | // TRANSLATORS: The following strings provide usage for command. These | 120 | printf("Usage: %s [OPTIONS]\n", PROGRAM_NAME); |
| 141 | // strings are displayed if the program is passed `--help' on the command | 121 | printf(" -c, --colors-only only display escape codes for colors\n"); |
| 142 | // line. The two strings referenced are: PROGRAM_NAME, and | 122 | printf(" -h, --help print this help and exit\n"); |
| 143 | // PACKAGE_BUGREPORT | 123 | printf(" -V, --version print version number and exit\n"); |
| 144 | printf(_("Usage: %s [OPTIONS]\n" | 124 | printf("\n"); |
| 145 | " -c, --colors-only only display escape codes for colors\n" | 125 | printf("Report bugs to <%s>.\n", PACKAGE_BUGREPORT); |
| 146 | " -h, --help print this help and exit\n" | ||
| 147 | " -V, --version print version number and exit\n" | ||
| 148 | "\n" | ||
| 149 | "Report bugs to <%s>.\n" | ||
| 150 | ), PROGRAM_NAME, PACKAGE_BUGREPORT | ||
| 151 | ); | ||
| 152 | return; | 126 | return; |
| 153 | } | 127 | } |
| 154 | 128 | ||
| @@ -156,18 +130,12 @@ void colors_usage(void) | |||
| 156 | /// displays version information | 130 | /// displays version information |
| 157 | void colors_version(void) | 131 | void colors_version(void) |
| 158 | { | 132 | { |
| 159 | // TRANSLATORS: The following strings provide version and copyright | 133 | printf("%s (%s) %s\n", PROGRAM_NAME, PACKAGE_NAME, PACKAGE_VERSION); |
| 160 | // information if the program is passed --version on the command line. | 134 | printf( "Written by David M. Syzdek.\n"); |
| 161 | // The three strings referenced are: PROGRAM_NAME, PACKAGE_NAME, | 135 | printf("\n"); |
| 162 | // PACKAGE_VERSION. | 136 | printf("%s\n", PACKAGE_COPYRIGHT); |
| 163 | printf(_("%s (%s) %s\n" | 137 | printf("This is free software; see the source for copying conditions. There is NO\n"); |
| 164 | "Written by David M. Syzdek.\n" | 138 | printf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); |
| 165 | "\n" | ||
| 166 | "%s\n" | ||
| 167 | "This is free software; see the source for copying conditions. There is NO\n" | ||
| 168 | "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" | ||
| 169 | ), PROGRAM_NAME, PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_COPYRIGHT | ||
| 170 | ); | ||
| 171 | return; | 139 | return; |
| 172 | } | 140 | } |
| 173 | 141 | ||
| @@ -217,13 +185,11 @@ int main(int argc, char * argv[]) | |||
| 217 | colors_version(); | 185 | colors_version(); |
| 218 | return(0); | 186 | return(0); |
| 219 | case '?': | 187 | case '?': |
| 220 | fprintf(stderr, _("Try `%s --help' for more information.\n"), PROGRAM_NAME); | 188 | fprintf(stderr, "Try `%s --help' for more information.\n", PROGRAM_NAME); |
| 221 | return(1); | 189 | return(1); |
| 222 | default: | 190 | default: |
| 223 | fprintf(stderr, _("%s: unrecognized option `--%c'\n" | 191 | fprintf(stderr, "%s: unrecognized option `--%c'\n", PROGRAM_NAME, c); |
| 224 | "Try `%s --help' for more information.\n" | 192 | fprintf(stderr, "Try `%s --help' for more information.\n", PROGRAM_NAME); |
| 225 | ), PROGRAM_NAME, c, PROGRAM_NAME | ||
| 226 | ); | ||
| 227 | return(1); | 193 | return(1); |
| 228 | }; | 194 | }; |
| 229 | }; | 195 | }; |
