diff options
author | Werner Koch <[email protected]> | 2020-08-25 08:38:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-08-25 08:38:29 +0000 |
commit | 32021dfa5bcaa056c18e4ec40fdcd0f8b7de382b (patch) | |
tree | 5a6053349363edf7686836df4c54bb891d4cd512 /tools/gpgconf.c | |
parent | gpg: Collapse duplicate subkeys. (diff) | |
download | gnupg-32021dfa5bcaa056c18e4ec40fdcd0f8b7de382b.tar.gz gnupg-32021dfa5bcaa056c18e4ec40fdcd0f8b7de382b.zip |
gpgconf,w32: New debug command --show-codepages.
* tools/gpgconf.c (aShowCodepages): New.
(opts): New command --show-codepages.
(main) [W32]: Implement
--
This is a Windows helper command to quickly check which code pages are
currently used. Useful for debugging. Has no effect on Unix.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/gpgconf.c')
-rw-r--r-- | tools/gpgconf.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/gpgconf.c b/tools/gpgconf.c index e68eecdd7..539461d80 100644 --- a/tools/gpgconf.c +++ b/tools/gpgconf.c @@ -68,7 +68,8 @@ enum cmd_and_opt_values aCreateSocketDir, aRemoveSocketDir, aApplyProfile, - aReload + aReload, + aShowCodepages }; @@ -99,6 +100,7 @@ static gpgrt_opt_t opts[] = { aKill, "kill", 256, N_("kill a given component")}, { aCreateSocketDir, "create-socketdir", 256, "@"}, { aRemoveSocketDir, "remove-socketdir", 256, "@"}, + ARGPARSE_c (aShowCodepages, "show-codepages", "@"), { 301, NULL, 0, N_("@\nOptions:\n ") }, @@ -107,7 +109,8 @@ static gpgrt_opt_t opts[] = { oQuiet, "quiet", 0, N_("quiet") }, { oDryRun, "dry-run", 0, N_("do not make any changes") }, { oRuntime, "runtime", 0, N_("activate changes at runtime, if possible") }, - ARGPARSE_s_i (oStatusFD, "status-fd", N_("|FD|write status info to this FD")), + ARGPARSE_s_i (oStatusFD, "status-fd", + N_("|FD|write status info to this FD")), /* hidden options */ { oHomedir, "homedir", 2, "@" }, { oBuilddir, "build-prefix", 2, "@" }, @@ -600,6 +603,7 @@ main (int argc, char **argv) case aKill: case aCreateSocketDir: case aRemoveSocketDir: + case aShowCodepages: cmd = pargs.r_opt; break; @@ -915,6 +919,18 @@ main (int argc, char **argv) } break; + case aShowCodepages: +#ifdef HAVE_W32_SYSTEM + { + get_outfp (&outfp); + es_fprintf (outfp, "Console: CP%u\n", GetConsoleOutputCP ()); + es_fprintf (outfp, "ANSI: CP%u\n", GetACP ()); + es_fprintf (outfp, "OEM: CP%u\n", GetOEMCP ()); + } +#endif + break; + + } if (outfp != es_stdout) |