nercone-shell 0.2.1__py3-none-any.whl → 0.2.3__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.
- nercone_shell/__main__.py +8 -2
- {nercone_shell-0.2.1.dist-info → nercone_shell-0.2.3.dist-info}/METADATA +2 -1
- nercone_shell-0.2.3.dist-info/RECORD +6 -0
- nercone_shell-0.2.1.dist-info/RECORD +0 -6
- {nercone_shell-0.2.1.dist-info → nercone_shell-0.2.3.dist-info}/WHEEL +0 -0
- {nercone_shell-0.2.1.dist-info → nercone_shell-0.2.3.dist-info}/entry_points.txt +0 -0
nercone_shell/__main__.py
CHANGED
|
@@ -31,6 +31,7 @@ NERSH_HISTORY_PATH = Path(os.environ.get("NERSH_HISTORY_PATH", str(Path(NERSH_PA
|
|
|
31
31
|
NERSH_CONFIG: dict = {}
|
|
32
32
|
NERSH_CONFIG_PATH = Path(os.environ.get("NERSH_CONFIG_PATH", str(Path(NERSH_PATH, "config.json"))))
|
|
33
33
|
NERSH_CONFIG_DEFAULT: dict = {
|
|
34
|
+
"show_version": True,
|
|
34
35
|
"override_env": {
|
|
35
36
|
"SHELL": f"{shutil.which('nersh')}"
|
|
36
37
|
},
|
|
@@ -146,6 +147,9 @@ def shorten_path(path: str) -> str:
|
|
|
146
147
|
return f"/{path_str}"
|
|
147
148
|
return path_str
|
|
148
149
|
|
|
150
|
+
def show_version():
|
|
151
|
+
print(f"Nersh v{VERSION}")
|
|
152
|
+
|
|
149
153
|
def reset():
|
|
150
154
|
global ENVIRONMENT, NERSH_CONFIG
|
|
151
155
|
ENVIRONMENT = {"PWD": f"{Path(Path("~").expanduser())}"}
|
|
@@ -181,7 +185,7 @@ def run_line(command: str) -> int:
|
|
|
181
185
|
args = command.strip().split(" ")
|
|
182
186
|
cmd = args[0]
|
|
183
187
|
if cmd == "version":
|
|
184
|
-
|
|
188
|
+
show_version()
|
|
185
189
|
elif cmd == "cd":
|
|
186
190
|
target = " ".join(args[1:])
|
|
187
191
|
if not target:
|
|
@@ -254,7 +258,9 @@ def main() -> int:
|
|
|
254
258
|
else:
|
|
255
259
|
readline.parse_and_bind("tab: complete")
|
|
256
260
|
readline.set_completer_delims(' \t\n;')
|
|
257
|
-
|
|
261
|
+
if NERSH_CONFIG.get("show_version", True):
|
|
262
|
+
show_version()
|
|
263
|
+
for p in NERSH_CONFIG.get("autoruns", []):
|
|
258
264
|
if Path(p).is_file():
|
|
259
265
|
with Path(p).open("r") as f:
|
|
260
266
|
run_script(f.read())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nercone-shell
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Modern shell for Developers
|
|
5
5
|
Author: Nercone
|
|
6
6
|
Author-email: Nercone <nercone@diamondgotcat.net>
|
|
@@ -8,6 +8,7 @@ License: MIT
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Dist: nercone-modern
|
|
11
12
|
Requires-Python: >=3.8
|
|
12
13
|
Description-Content-Type: text/markdown
|
|
13
14
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
nercone_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
nercone_shell/__main__.py,sha256=HKRtx6fZAYaqBNuPMvI5D3alAE1YNMCPBBtMXXllhck,9707
|
|
3
|
+
nercone_shell-0.2.3.dist-info/WHEEL,sha256=YUH1mBqsx8Dh2cQG2rlcuRYUhJddG9iClegy4IgnHik,79
|
|
4
|
+
nercone_shell-0.2.3.dist-info/entry_points.txt,sha256=STrGlvrPc2Rr5ktWVfiZ_5Lr7i1GcfOMvsTxL6768sw,55
|
|
5
|
+
nercone_shell-0.2.3.dist-info/METADATA,sha256=5V-Dxb9Zx9l8fXlZiPNd6FlOsHfd3xI-EqVDHpSO5sE,465
|
|
6
|
+
nercone_shell-0.2.3.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
nercone_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
nercone_shell/__main__.py,sha256=Ru2-HtdgAq8qJr7UkFykzwH16D0ep2qaEHHODq6vUI8,9567
|
|
3
|
-
nercone_shell-0.2.1.dist-info/WHEEL,sha256=YUH1mBqsx8Dh2cQG2rlcuRYUhJddG9iClegy4IgnHik,79
|
|
4
|
-
nercone_shell-0.2.1.dist-info/entry_points.txt,sha256=STrGlvrPc2Rr5ktWVfiZ_5Lr7i1GcfOMvsTxL6768sw,55
|
|
5
|
-
nercone_shell-0.2.1.dist-info/METADATA,sha256=M5YQxd2iwzuHGSwwHFKZHe5rDMBmQM1MqR9ClyjSdfc,435
|
|
6
|
-
nercone_shell-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|