From f33e751683712d38ce3558aa2729dcdd14590892 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Fri, 10 Jan 2025 19:01:36 +0100 Subject: [PATCH] Added viewing of path specified by command line argument. --- wobbl_tools/text/tree_view.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wobbl_tools/text/tree_view.py b/wobbl_tools/text/tree_view.py index 7b5fdcd..b46aa1d 100644 --- a/wobbl_tools/text/tree_view.py +++ b/wobbl_tools/text/tree_view.py @@ -1,5 +1,6 @@ #!/usr/bin/python3 import os +import sys from ..utils import module_path from .format import format_string @@ -65,4 +66,10 @@ def tree_view( 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__"]))