trefoil-cli 0.1.0__tar.gz → 0.2.0__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.
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/PKG-INFO +1 -1
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/package.py +9 -0
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/pyproject.toml +1 -1
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/trefoil_cli.egg-info/PKG-INFO +1 -1
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/setup.cfg +0 -0
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/trefoil_cli.egg-info/SOURCES.txt +0 -0
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/trefoil_cli.egg-info/dependency_links.txt +0 -0
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/trefoil_cli.egg-info/entry_points.txt +0 -0
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/trefoil_cli.egg-info/requires.txt +0 -0
- {trefoil_cli-0.1.0 → trefoil_cli-0.2.0}/trefoil_cli.egg-info/top_level.txt +0 -0
|
@@ -28,6 +28,7 @@ Usage: trefoil <domain> <command> [args]
|
|
|
28
28
|
import argparse
|
|
29
29
|
import base64
|
|
30
30
|
import getpass
|
|
31
|
+
import importlib.metadata
|
|
31
32
|
import json
|
|
32
33
|
import os
|
|
33
34
|
import sys
|
|
@@ -446,8 +447,16 @@ def print_table(header, rows, empty):
|
|
|
446
447
|
print(" ".join(cell.ljust(w) for cell, w in zip(row, widths)).rstrip())
|
|
447
448
|
|
|
448
449
|
|
|
450
|
+
def cli_version():
|
|
451
|
+
try:
|
|
452
|
+
return importlib.metadata.version("trefoil-cli")
|
|
453
|
+
except importlib.metadata.PackageNotFoundError:
|
|
454
|
+
return "unknown"
|
|
455
|
+
|
|
456
|
+
|
|
449
457
|
def main():
|
|
450
458
|
parser = argparse.ArgumentParser(prog="trefoil", description="trefoil <domain> <command> [args]")
|
|
459
|
+
parser.add_argument("--version", action="version", version=f"%(prog)s {cli_version()}")
|
|
451
460
|
domains = parser.add_subparsers(dest="domain", metavar="<domain>", required=True)
|
|
452
461
|
|
|
453
462
|
server = argparse.ArgumentParser(add_help=False)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|