Added viewing of path specified by command line argument.
This commit is contained in:
parent
dfd05e1732
commit
f33e751683
1 changed files with 8 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from ..utils import module_path
|
from ..utils import module_path
|
||||||
from .format import format_string
|
from .format import format_string
|
||||||
|
|
||||||
|
@ -65,4 +66,10 @@ def tree_view(
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(tree_view(module_path, exclude_names=["__pycache__"]))
|
if len(sys.argv) == 1: # use first command line argument when set, else use the module path
|
||||||
|
path = module_path
|
||||||
|
|
||||||
|
else:
|
||||||
|
path = sys.argv[1]
|
||||||
|
|
||||||
|
print(tree_view(path, exclude_names=["__pycache__"]))
|
||||||
|
|
Loading…
Reference in a new issue