k8s-helper-cli 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl

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.
k8s_helper/__init__.py CHANGED
@@ -20,7 +20,7 @@ from .utils import (
20
20
  create_service_manifest
21
21
  )
22
22
 
23
- __version__ = "0.1.0"
23
+ __version__ = "0.2.0"
24
24
  __author__ = "Harshit Chatterjee"
25
25
  __email__ = "harshitchatterjee50@gmail.com"
26
26
 
k8s_helper/cli.py CHANGED
@@ -23,10 +23,24 @@ from .utils import (
23
23
  parse_env_vars,
24
24
  parse_labels
25
25
  )
26
+ from . import __version__
27
+
28
+ def version_callback(value: bool):
29
+ """Version callback for the CLI"""
30
+ if value:
31
+ typer.echo(f"k8s-helper-cli version {__version__}")
32
+ raise typer.Exit()
26
33
 
27
34
  app = typer.Typer(help="k8s-helper: Simplified Kubernetes operations")
28
35
  console = Console()
29
36
 
37
+ @app.callback()
38
+ def main(
39
+ version: Optional[bool] = typer.Option(None, "--version", callback=version_callback, is_eager=True, help="Show version and exit")
40
+ ):
41
+ """Main callback to handle global options"""
42
+ return
43
+
30
44
  # Global options
31
45
  namespace_option = typer.Option(None, "--namespace", "-n", help="Kubernetes namespace")
32
46
  output_option = typer.Option("table", "--output", "-o", help="Output format: table, yaml, json")