trefoil-cli 0.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trefoil-cli
3
- Version: 0.0.2
3
+ Version: 0.2.0
4
4
  Summary: CLI for the trefoil agent server
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: pyyaml>=6
@@ -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)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "trefoil-cli"
3
- version = "0.0.2"
3
+ version = "0.2.0"
4
4
  description = "CLI for the trefoil agent server"
5
5
  requires-python = ">=3.10"
6
6
  dependencies = ["pyyaml>=6"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trefoil-cli
3
- Version: 0.0.2
3
+ Version: 0.2.0
4
4
  Summary: CLI for the trefoil agent server
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: pyyaml>=6
File without changes