twd-m4sc0 1.2.2__py3-none-any.whl → 1.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
twd/twd.py CHANGED
@@ -64,6 +64,13 @@ def show_directory(output=True, simple_output=False):
64
64
  else:
65
65
  output_handler(f"Current TWD: {TWD}", TWD, output, simple_output)
66
66
 
67
+ def unset_directory(output=True, simple_output=False):
68
+ if not os.path.exists(TWD_FILE):
69
+ output_handler(f"No TWD file found", None, output, simple_output)
70
+ else:
71
+ os.remove(TWD_FILE)
72
+ output_handler(f"TWD File deleted and TWD unset", None, output, simple_output)
73
+
67
74
  def get_package_version():
68
75
  try:
69
76
  return version("twd_m4sc0")
@@ -76,6 +83,7 @@ def main():
76
83
  parser.add_argument('-s', '--save', nargs='?', const='', help="Save the current or specified directory")
77
84
  parser.add_argument('-g', '--go', action='store_true', help="Go to the saved directory")
78
85
  parser.add_argument('-l', '--list', action='store_true', help="Show saved TWD")
86
+ parser.add_argument('-u', '--unset', action='store_true', help="Unset the saved TWD")
79
87
  parser.add_argument('-v', '--version', action='version', version=f'TWD Version: {get_package_version()}', help='Show the current version of TWD installed')
80
88
  parser.add_argument('--shell', action='store_true', help="Output shell function for integration")
81
89
  parser.add_argument('--simple-output', action='store_true', help="Only print essential output (new directory, absolute path, etc.)")
@@ -105,6 +113,8 @@ def main():
105
113
  return go_to_directory(output, simple_output)
106
114
  elif args.list:
107
115
  show_directory(output, simple_output)
116
+ elif args.unset:
117
+ unset_directory(output, simple_output)
108
118
  else:
109
119
  parser.print_help()
110
120
  return 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: twd_m4sc0
3
- Version: 1.2.2
3
+ Version: 1.3.0
4
4
  Summary: A tool to temporarily save and go to a working directory
5
5
  Home-page: https://github.com/m4sc0/twd
6
6
  Author: m4sc0
@@ -0,0 +1,11 @@
1
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ tests/test_twd.py,sha256=XrxOo99oqida_7qZ48pA6BCazZekDmG5syw9NvjZWDU,484
3
+ twd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ twd/__main__.py,sha256=gM_Py51pQFH3CXdDIuPzBW6eNlFH1UHeRAmgAPWQyik,61
5
+ twd/twd.py,sha256=XZPt2QuU6Huf4lx69C1zO36Xd8Vm6vcvwXeZWwmtlSE,4122
6
+ twd_m4sc0-1.3.0.dist-info/LICENSE,sha256=eQSDjcD_fvOwfjmrzxKJhtZsSI39seMawuvsgeD_dfw,1062
7
+ twd_m4sc0-1.3.0.dist-info/METADATA,sha256=dO_TCb51kfq20yC11PzQiyqhMkYAoBlSJOHIekTL-0E,2166
8
+ twd_m4sc0-1.3.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
9
+ twd_m4sc0-1.3.0.dist-info/entry_points.txt,sha256=QfYDHHjipkVN4oalpACFmIeYHb7GQCJY4SC12bTsiQQ,37
10
+ twd_m4sc0-1.3.0.dist-info/top_level.txt,sha256=PXToru2Yr2Xh3F_F-pHXtuOQVp5x7KKCPFf94P_VI5U,10
11
+ twd_m4sc0-1.3.0.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- tests/test_twd.py,sha256=XrxOo99oqida_7qZ48pA6BCazZekDmG5syw9NvjZWDU,484
3
- twd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- twd/__main__.py,sha256=gM_Py51pQFH3CXdDIuPzBW6eNlFH1UHeRAmgAPWQyik,61
5
- twd/twd.py,sha256=LSWm60sz1Z4KYS1mGt2RXlgFdZQ_5oBz96m8wh-LziU,3672
6
- twd_m4sc0-1.2.2.dist-info/LICENSE,sha256=eQSDjcD_fvOwfjmrzxKJhtZsSI39seMawuvsgeD_dfw,1062
7
- twd_m4sc0-1.2.2.dist-info/METADATA,sha256=vorXOoNwUwZTZVA7XDxE7b7WonFMGugsFJ6mcALfE1M,2166
8
- twd_m4sc0-1.2.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
9
- twd_m4sc0-1.2.2.dist-info/entry_points.txt,sha256=QfYDHHjipkVN4oalpACFmIeYHb7GQCJY4SC12bTsiQQ,37
10
- twd_m4sc0-1.2.2.dist-info/top_level.txt,sha256=PXToru2Yr2Xh3F_F-pHXtuOQVp5x7KKCPFf94P_VI5U,10
11
- twd_m4sc0-1.2.2.dist-info/RECORD,,