CLI: make re match exactly for -l, -L

This commit is contained in:
Doug Blank 2016-04-23 18:34:10 -04:00
parent 5cfb8b1e17
commit 7e58e2254d

View File

@ -183,7 +183,7 @@ class CLIDbManager(object):
(name, dirpath, path_name, last,
tval, enable, stock_id, backend_type, version) = item
if (database_names is None or
any([re.match(dbname, name) for dbname in database_names])):
any([re.match("^" + dbname + "$", name) for dbname in database_names])):
summary = self.get_dbdir_summary(dirpath, name)
print(_("Family Tree \"%s\":") % summary[_("Family Tree")])
for item in sorted(summary):
@ -203,7 +203,7 @@ class CLIDbManager(object):
(name, dirpath, path_name, last,
tval, enable, stock_id, backend_type, version) = item
if (database_names is None or
any([re.match(dbname, name) for dbname in database_names])):
any([re.match("^" + dbname + "$", name) for dbname in database_names])):
retval = self.get_dbdir_summary(dirpath, name)
summary_list.append( retval )
return summary_list