]> sourceware.org Git - newlib-cygwin.git/commitdiff
regtool: allow /proc/registry{,32,64}/ registry path prefix
authorBrian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Mon, 11 Nov 2019 17:29:00 +0000 (10:29 -0700)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 13 Nov 2019 08:39:04 +0000 (09:39 +0100)
The user can supply the registry path prefix /proc/registry{,32,64}/ to
use path completion.

winsup/doc/utils.xml
winsup/utils/regtool.cc

index 043ed7358955f949f5358066c11d91fdd64a4630..5f266bcb11a2f69319cfb31270c83a63317893b4 100644 (file)
@@ -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>
 
index a44d907688e597974f92a65d9668629e4814c8a4..f91e61d00e616f75def2475540c6651cd1df3ca4 100644 (file)
@@ -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;
This page took 0.034421 seconds and 5 git commands to generate.