xmyshell 0.2.23__tar.gz → 0.2.24__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.
Files changed (28) hide show
  1. {xmyshell-0.2.23/xmyshell.egg-info → xmyshell-0.2.24}/PKG-INFO +1 -1
  2. {xmyshell-0.2.23 → xmyshell-0.2.24}/pyproject.toml +1 -1
  3. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/__main__.py +1 -1
  4. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/completer.py +3 -5
  5. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/data/commands.json +1347 -0
  6. {xmyshell-0.2.23 → xmyshell-0.2.24/xmyshell.egg-info}/PKG-INFO +1 -1
  7. {xmyshell-0.2.23 → xmyshell-0.2.24}/LICENSE +0 -0
  8. {xmyshell-0.2.23 → xmyshell-0.2.24}/README.md +0 -0
  9. {xmyshell-0.2.23 → xmyshell-0.2.24}/setup.cfg +0 -0
  10. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/__init__.py +0 -0
  11. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/environment.py +0 -0
  12. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/init.py +0 -0
  13. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/injection.py +0 -0
  14. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/kernel.py +0 -0
  15. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/keybindings.py +0 -0
  16. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/main.py +0 -0
  17. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/meta.py +0 -0
  18. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/stubs/__init__.py +0 -0
  19. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/stubs/__init__.pyi +0 -0
  20. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/stubs/py.typed +0 -0
  21. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/themes.py +0 -0
  22. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/update.py +0 -0
  23. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell/utils.py +0 -0
  24. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell.egg-info/SOURCES.txt +0 -0
  25. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell.egg-info/dependency_links.txt +0 -0
  26. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell.egg-info/entry_points.txt +0 -0
  27. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell.egg-info/requires.txt +0 -0
  28. {xmyshell-0.2.23 → xmyshell-0.2.24}/xmyshell.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xmyshell
3
- Version: 0.2.23
3
+ Version: 0.2.24
4
4
  Summary: XmyShell is a shell-like tool built on top of prompt_toolkit which provides a persistent Python runtime.
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xmyshell"
3
- version = "0.2.23"
3
+ version = "0.2.24"
4
4
  description = "XmyShell is a shell-like tool built on top of prompt_toolkit which provides a persistent Python runtime."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -10,7 +10,7 @@ def main() -> None:
10
10
  xmyshell_main()
11
11
  elif argv[1] == "--update":
12
12
  subprocess.run([sys.executable, "-m", "xmyshell.update"] + argv[2:])
13
- elif argv[1] == "--version":
13
+ elif argv[1] == "--version" or argv[1] == "-v":
14
14
  from .meta import WELCOME_MESSAGE
15
15
  print(WELCOME_MESSAGE)
16
16
  elif argv[1] == "--help":
@@ -368,15 +368,10 @@ class ShellCompleter(Completer):
368
368
  last_word = parts[-1]
369
369
 
370
370
  for part in parts[1:-1]:
371
- if part.startswith("-"):
372
- continue
373
371
  if sub_cmd.get("_global"):
374
372
  global_flags.update(sub_cmd["_global"])
375
373
  if sub_cmd.get(part):
376
374
  sub_cmd = sub_cmd[part]
377
- else:
378
- sub_cmd = {}
379
- break
380
375
 
381
376
  for name in sorted(sub_cmd.keys()):
382
377
  if name == "_global" or name == "_flags": continue
@@ -389,6 +384,9 @@ class ShellCompleter(Completer):
389
384
  display_meta="subcommand"
390
385
  )
391
386
 
387
+ # not auto complete flags unless user types them
388
+ if last_word == "": return
389
+
392
390
  for name in sorted(sub_cmd.get("_flags") or set()):
393
391
  if name in parts[:-1]: continue
394
392
  if name.startswith(last_word):