[pass] [PATCH] Add find/search command
Alexis
surryhill at gmail.com
Thu Apr 4 17:32:07 CEST 2013
Hi Jason,
I'm happy to hear that the feature will land and I like your
improvements to the wording in the help and man page.
I somewhat dislike the extra echo, that prints the search terms,
since these are still visible as the commandline arguments.
Or is this only for debugging purposes at the moment?
I do agree, that not matching directory names is a shortcoming.
A quick look at the tree.c reveals that the following
simple patch allows tree to also list directories that match the
given pattern and prune the ones that don't.
When a directory matches the given pattern should only the directory
or even all of it's files shown by tree?
diff --git a/tree.c b/tree.c
index 19cf368..5eea9a5 100644
--- a/tree.c
+++ b/tree.c
@@ -745,7 +745,7 @@ struct _info **getfulltree(char *d, u_long lev,
dev_t dev, off_t *size, char **e
saveino((*dir)->inode, (*dir)->dev);
(*dir)->child =
getfulltree(path,lev+1,dev,&((*dir)->size),&((*dir)->err));
}
- if (pruneflag && (*dir)->child == NULL) {
+ if (pruneflag && (*dir)->child == NULL && patmatch((*dir)->name,pattern) == 0) {
sp = *dir;
for(p=dir;*p;p++) *p = *(p+1);
n--;
This patch is obviously far from finished, and yet it shows
that commandline options to include directory names when
matching with -P or -I are feasible.
I'll dig a little deeper...
Alexis
More information about the Password-Store
mailing list