public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] regtool: allow /proc/registry{, 32, 64}/ registry path prefix Date: Wed, 13 Nov 2019 09:17:00 -0000 [thread overview] Message-ID: <20191113091729.36264.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d3110717f0a39ec7d00921c048bfd3c8f8efe7c4 commit d3110717f0a39ec7d00921c048bfd3c8f8efe7c4 Author: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca> Date: Mon Nov 11 10:29:00 2019 -0700 regtool: allow /proc/registry{,32,64}/ registry path prefix The user can supply the registry path prefix /proc/registry{,32,64}/ to use path completion. Diff: --- winsup/doc/utils.xml | 7 +++++-- winsup/utils/regtool.cc | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/winsup/doc/utils.xml b/winsup/doc/utils.xml index 043ed73..5f266bc 100644 --- a/winsup/doc/utils.xml +++ b/winsup/doc/utils.xml @@ -1976,8 +1976,11 @@ remote host in either \\hostname or hostname: format and prefix is any of: users HKU HKEY_USERS You can use forward slash ('/') as a separator instead of backslash, in -that case backslash is treated as escape character -Example: regtool get '\user\software\Microsoft\Clock\iFormat' +that case backslash is treated as an escape character. +You can also supply the registry path prefix /proc/registry{,32,64}/ to +use path completion. +Example: + regtool list '/HKLM/SOFTWARE/Classes/MIME/Database/Content Type/audio\\/wav' </screen> </refsect1> diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc index a44d907..f91e61d 100644 --- a/winsup/utils/regtool.cc +++ b/winsup/utils/regtool.cc @@ -166,11 +166,13 @@ usage (FILE *where = stderr) " machine HKLM HKEY_LOCAL_MACHINE\n" " users HKU HKEY_USERS\n" "\n" - "If the keyname starts with a forward slash ('/'), the forward slash is used\n" - "as separator and the backslash can be used as escape character.\n"); + "You can use forward slash ('/') as a separator instead of backslash, in\n" + "that case backslash is treated as an escape character.\n" + "You can also supply the registry path prefix /proc/registry{,32,64}/ to\n" + "use path completion.\n"); fprintf (where, "" "Example:\n" - "%s list '/machine/SOFTWARE/Classes/MIME/Database/Content Type/audio\\/wav'\n\n", prog_name); + "%s list '/HKLM/SOFTWARE/Classes/MIME/Database/Content Type/audio\\/wav'\n\n", prog_name); } if (where == stderr) fprintf (where, @@ -350,6 +352,15 @@ find_key (int howmanyparts, REGSAM access, int option = 0) *h = 0; n = e; } + else if (strncmp ("\\proc\\registry", n, strlen ("\\proc\\registry")) == 0) + { + /* skip /proc/registry{,32,64}/ prefix */ + n += strlen ("\\proc\\registry"); + if (strncmp ("64", n, strlen ("64")) == 0) + n += strlen ("64"); + else if (strncmp ("32", n, strlen ("32")) == 0) + n += strlen ("32"); + } while (*n != '\\') n++; *n++ = 0;
reply other threads:[~2019-11-13 9:17 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20191113091729.36264.qmail@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).