nerd_tree/vfind.py

25 lines
580 B
Python
Raw Normal View History

2024-01-29 14:07:09 +01:00
#!/usr/bin/env python
from src.cmdline_parser import cmd_args
from src.tree_find import NerdTreeFind
if __name__ == '__main__':
print(cmd_args.path)
print(cmd_args.show_children_nodes)
path = cmd_args.path
pattern = cmd_args.pattern
show_children_nodes = cmd_args.show_children_nodes
2024-01-31 12:02:13 +01:00
# opts for generatign the tree
opts = {
'items_to_exclude' : cmd_args.exclude or [],
}
# opts for find
2024-01-29 14:07:09 +01:00
find_opts = {
'dont_show_children_nodes': not show_children_nodes
}
2024-01-31 12:02:13 +01:00
ntree = NerdTreeFind(path, opts=opts)
2024-01-29 14:07:09 +01:00
ntree.find(pattern, opts=find_opts)