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 +1 -1
- k8s_helper/cli.py +14 -0
- k8s_helper_cli-0.2.0.dist-info/METADATA +978 -0
- k8s_helper_cli-0.2.0.dist-info/RECORD +11 -0
- k8s_helper_cli-0.1.1.dist-info/METADATA +0 -491
- k8s_helper_cli-0.1.1.dist-info/RECORD +0 -11
- {k8s_helper_cli-0.1.1.dist-info → k8s_helper_cli-0.2.0.dist-info}/WHEEL +0 -0
- {k8s_helper_cli-0.1.1.dist-info → k8s_helper_cli-0.2.0.dist-info}/entry_points.txt +0 -0
- {k8s_helper_cli-0.1.1.dist-info → k8s_helper_cli-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {k8s_helper_cli-0.1.1.dist-info → k8s_helper_cli-0.2.0.dist-info}/top_level.txt +0 -0
k8s_helper/__init__.py
CHANGED
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")
|