summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2003-04-20 21:52:55 +0000
committerRichard Sharpe <sharpe@samba.org>2003-04-20 21:52:55 +0000
commit60801e810503a89ba1253e3e0b688a33f7465182 (patch)
treed2c506c909b7e9f03e278878110be10666b5d07c /source3/utils
parent6f499782dcf6bd621f5e076046bffdc714fa01f9 (diff)
downloadsamba-60801e810503a89ba1253e3e0b688a33f7465182.tar.gz
samba-60801e810503a89ba1253e3e0b688a33f7465182.tar.bz2
samba-60801e810503a89ba1253e3e0b688a33f7465182.zip
Add a -f command-line flag to specify printing all paths or only terminal
paths. (This used to be commit 0741369c59bcb6057f6b32d3fe4f6dec08ce4ae3)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/editreg.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/utils/editreg.c b/source3/utils/editreg.c
index b35e278ab0..1b148f3bd1 100644
--- a/source3/utils/editreg.c
+++ b/source3/utils/editreg.c
@@ -330,6 +330,7 @@ Hope this helps.... (Although it was "fun" for me to uncover this things,
static int verbose = 0;
static int print_security = 0;
+static int full_print = 0;
/*
* These definitions are for the in-memory registry structure.
@@ -2990,7 +2991,7 @@ int print_key(const char *path, char *name, char *class_name, int root,
int terminal, int vals)
{
- /*if (terminal)*/ fprintf(stdout, "[%s%s]\n", path, name);
+ if (full_print || terminal) fprintf(stdout, "[%s%s]\n", path, name);
return 1;
}
@@ -3142,9 +3143,10 @@ int print_val(const char *path, char *val_name, int val_type, int data_len,
void usage(void)
{
- fprintf(stderr, "Usage: editreg [-v] [-p] [-k] [-s] [-c <command-file>] <registryfile>\n");
+ fprintf(stderr, "Usage: editreg [-f] [-v] [-p] [-k] [-s] [-c <command-file>] <registryfile>\n");
fprintf(stderr, "Version: 0.1\n\n");
fprintf(stderr, "\n\t-v\t sets verbose mode");
+ fprintf(stderr, "\n\t-f\t sets full print mode where non-terminals are printed");
fprintf(stderr, "\n\t-p\t prints the registry");
fprintf(stderr, "\n\t-s\t prints security descriptors");
fprintf(stderr, "\n\t-c <command-file>\t specifies a command file");
@@ -3172,7 +3174,7 @@ int main(int argc, char *argv[])
* Now, process the arguments
*/
- while ((opt = getopt(argc, argv, "spvko:c:")) != EOF) {
+ while ((opt = getopt(argc, argv, "fspvko:c:")) != EOF) {
switch (opt) {
case 'c':
commands = 1;
@@ -3180,6 +3182,11 @@ int main(int argc, char *argv[])
regf_opt += 2;
break;
+ case 'f':
+ full_print = 1;
+ regf_opt++;
+ break;
+
case 'o':
out_file_name = optarg;
regf_opt += 2;
@@ -3192,6 +3199,7 @@ int main(int argc, char *argv[])
case 's':
print_security++;
+ full_print++;
regf_opt++;
break;