xmyshell 0.2.13__tar.gz → 0.2.15__tar.gz
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.
- {xmyshell-0.2.13/xmyshell.egg-info → xmyshell-0.2.15}/PKG-INFO +1 -1
- {xmyshell-0.2.13 → xmyshell-0.2.15}/pyproject.toml +1 -1
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/completer.py +11 -5
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/data/commands.json +990 -50
- xmyshell-0.2.15/xmyshell/injection.py +42 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/main.py +12 -3
- {xmyshell-0.2.13 → xmyshell-0.2.15/xmyshell.egg-info}/PKG-INFO +1 -1
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell.egg-info/SOURCES.txt +1 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/LICENSE +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/README.md +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/setup.cfg +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/__init__.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/__main__.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/environment.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/init.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/kernel.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/keybindings.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/lexer.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/meta.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/stubs/__init__.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/stubs/__init__.pyi +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/stubs/py.typed +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/themes.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/update.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell/utils.py +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell.egg-info/dependency_links.txt +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell.egg-info/entry_points.txt +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell.egg-info/requires.txt +0 -0
- {xmyshell-0.2.13 → xmyshell-0.2.15}/xmyshell.egg-info/top_level.txt +0 -0
|
@@ -158,7 +158,10 @@ class ShellCompleter(Completer):
|
|
|
158
158
|
in_string = in_string or last.startswith('"') or last.startswith("'")
|
|
159
159
|
last = last.lstrip('"\'')
|
|
160
160
|
if last == '~': return # don't remove this
|
|
161
|
-
|
|
161
|
+
try:
|
|
162
|
+
path = os.path.expanduser(shlex.split(last)[0])
|
|
163
|
+
except (ValueError, IndexError):
|
|
164
|
+
path = os.path.expanduser(last)
|
|
162
165
|
dirname = os.path.dirname(path) or "."
|
|
163
166
|
prefix = os.path.basename(path).strip('"\'')
|
|
164
167
|
|
|
@@ -338,7 +341,10 @@ class ShellCompleter(Completer):
|
|
|
338
341
|
yield from self._environment_completion(text)
|
|
339
342
|
|
|
340
343
|
def _subcommand_completion(self, text: str):
|
|
341
|
-
|
|
344
|
+
try:
|
|
345
|
+
parts = shlex.split(text)
|
|
346
|
+
except ValueError:
|
|
347
|
+
parts = text.split()
|
|
342
348
|
if not parts: return
|
|
343
349
|
sub_cmd = COMMAND_TREE.get(parts[0])
|
|
344
350
|
if not sub_cmd: return
|
|
@@ -362,7 +368,7 @@ class ShellCompleter(Completer):
|
|
|
362
368
|
|
|
363
369
|
for name in sorted(sub_cmd.keys()):
|
|
364
370
|
if name == "_global" or name == "_flags": continue
|
|
365
|
-
if name in parts: continue
|
|
371
|
+
if name in parts[:-1]: continue
|
|
366
372
|
if name.startswith(last_word):
|
|
367
373
|
yield Completion(
|
|
368
374
|
name,
|
|
@@ -372,7 +378,7 @@ class ShellCompleter(Completer):
|
|
|
372
378
|
)
|
|
373
379
|
|
|
374
380
|
for name in sorted(sub_cmd.get("_flags") or set()):
|
|
375
|
-
if name in parts: continue
|
|
381
|
+
if name in parts[:-1]: continue
|
|
376
382
|
if name.startswith(last_word):
|
|
377
383
|
yield Completion(
|
|
378
384
|
name,
|
|
@@ -382,7 +388,7 @@ class ShellCompleter(Completer):
|
|
|
382
388
|
)
|
|
383
389
|
|
|
384
390
|
for name in sorted(global_flags):
|
|
385
|
-
if name in parts: continue
|
|
391
|
+
if name in parts[:-1]: continue
|
|
386
392
|
if name.startswith(last_word):
|
|
387
393
|
yield Completion(
|
|
388
394
|
name,
|