M poetry.lock => poetry.lock +13 -1
@@ 1212,6 1212,18 @@ docs = ["matplotlib", "numpydoc (>=1.1.0,<1.2.0)", "sphinx", "sphinx-book-theme"
test = ["pytest", "pytest-cov"]
[[package]]
+name = "shtab"
+version = "1.5.8"
+description = "Automagic shell tab completion for Python CLI applications"
+category = "main"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "shtab-1.5.8-py2.py3-none-any.whl", hash = "sha256:1d326ea131edbba96e0489470a2c969da1976a586a2d9376bb4923a6fe8eaae0"},
+ {file = "shtab-1.5.8.tar.gz", hash = "sha256:1f944e2e33c1554be69e6b26ef638ba3b516ac9449fdd2a40d197f9061c8bed8"},
+]
+
+[[package]]
name = "six"
version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
@@ 1365,4 1377,4 @@ files = [
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
-content-hash = "8bb8dd312657adacce2161e809c021e790fb00580c1ebe7868ab1d1e2a57acdd"
+content-hash = "36388ea46fb3b43898275a3b617628799d8c21be817fdb4b18a851667cd6ef3b"
M pyproject.toml => pyproject.toml +2 -1
@@ 1,6 1,6 @@
[tool.poetry]
name = "torrentmap"
-version = "1.0.1"
+version = "1.0.2"
description = "Torrent scraping and geolocation tool"
authors = ["Piotr Machura <piotr@machura.xyz>"]
license = "GPL-2.0-only"
@@ 14,6 14,7 @@ bitstring = "^4.0.1"
geopandas = "^0.12.2"
matplotlib = "^3.6.3"
country-converter = "^0.8.0"
+shtab = "^1.5.8"
[tool.poetry.group.dev.dependencies]
black = "^22.12.0"
M torrentmap/cli.py => torrentmap/cli.py +2 -1
@@ 12,6 12,7 @@ from os import environ as env
from os import remove as rm
from pathlib import Path
+import shtab
from .client import get_ips
from .mapgen import worldmap
from .torrent import Torrent
@@ 160,7 161,7 @@ def make_parser() -> argparse.ArgumentParser:
help="Log file (defaul /dev/stderr)",
)
parser.set_defaults(func=lambda _: parser.print_help())
-
+ shtab.add_argument_to(parser, ["--print-completion"])
subparsers = parser.add_subparsers()
# LIST