mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 00:07:36 +08:00
* regtool.cc (find_key): Add support for custom key separator.
(usage): Document it.
This commit is contained in:
parent
9b6947db55
commit
403985a498
@ -1,3 +1,8 @@
|
||||
2002-08-07 Igor Pechtchanski <pechtcha@cs.nyu.edu>
|
||||
|
||||
* regtool.cc (find_key): Add support for custom key separator.
|
||||
(usage): Document it.
|
||||
|
||||
2002-08-02 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* mkgroup.c (main): Don't print an entry for "Everyone".
|
||||
|
@ -14,11 +14,15 @@ details. */
|
||||
#include <getopt.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define DEFAULT_KEY_SEPARATOR '\\'
|
||||
|
||||
enum
|
||||
{
|
||||
KT_AUTO, KT_INT, KT_STRING, KT_EXPAND, KT_MULTI
|
||||
} key_type = KT_AUTO;
|
||||
|
||||
char key_sep = DEFAULT_KEY_SEPARATOR;
|
||||
|
||||
#define LIST_KEYS 0x01
|
||||
#define LIST_VALS 0x02
|
||||
#define LIST_ALL (LIST_KEYS | LIST_VALS)
|
||||
@ -39,10 +43,11 @@ static struct option longopts[] =
|
||||
{"string", no_argument, NULL, 's'},
|
||||
{"verbose", no_argument, NULL, 'v'},
|
||||
{"version", no_argument, NULL, 'V'},
|
||||
{"key-separator", required_argument, NULL, 'K'},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
static char opts[] = "ehiklmpqsvV";
|
||||
static char opts[] = "ehiklmpqsvVK::";
|
||||
|
||||
int listwhat = 0;
|
||||
int postfix = 0;
|
||||
@ -83,6 +88,9 @@ usage (FILE *where = stderr)
|
||||
" -m, --multi-string set type to REG_MULTI_SZ\n"
|
||||
" -s, --string set type to REG_SZ\n"
|
||||
"\n"
|
||||
"Options for 'set' and 'unset' Actions:\n"
|
||||
" -K<c>, --key-separator[=]<c> set key separator to <c> instead of '\\'\n"
|
||||
"\n"
|
||||
"Other Options:\n"
|
||||
" -h, --help output usage information and exit\n"
|
||||
" -q, --quiet no error output, just nonzero return if KEY/VALUE missing\n"
|
||||
@ -308,9 +316,9 @@ find_key (int howmanyparts, REGSAM access)
|
||||
e = n + strlen (n);
|
||||
if (howmanyparts > 1)
|
||||
{
|
||||
while (n < e && *e != '\\')
|
||||
while (n < e && *e != key_sep)
|
||||
e--;
|
||||
if (*e != '\\')
|
||||
if (*e != key_sep)
|
||||
{
|
||||
key = wkprefixes[i].key;
|
||||
value = n;
|
||||
@ -661,6 +669,9 @@ main (int argc, char **_argv)
|
||||
case 'V':
|
||||
print_version ();
|
||||
exit (0);
|
||||
case 'K':
|
||||
key_sep = *optarg;
|
||||
break;
|
||||
default :
|
||||
usage ();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user