Skip to content

Commit 0810db9

Browse files
Add --version command line option (#40)
* Add --version command line option * Set version to 1.0.0
1 parent d2bcc4a commit 0810db9

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ optional arguments:
3434
Resource to monitor
3535
--namespace NAMESPACE
3636
Look only within this namespace
37+
--version show program's version number and exit
3738
3839
```
3940

k8s/cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from enum import Enum
44

55
from .components import MAPPINGS
6+
from k8s.consts import VERSION
67

78

89
class Default(Enum):
@@ -111,6 +112,13 @@ class Default(Enum):
111112
"help": "Look only within this namespace",
112113
},
113114
),
115+
(
116+
"--version",
117+
{
118+
"action": "version",
119+
"version": "%(prog)s {}".format(VERSION),
120+
},
121+
),
114122
]
115123

116124

k8s/consts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
RESULT_CRITICAL = "One or more errors encountered"
88
RESULT_WARNING = "One or more warnings encountered"
99

10+
VERSION = "1.0.0"
11+
1012

1113
class NaemonState(Enum):
1214
OK = 0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "check_k8s"
3-
version = "0.1.0"
3+
version = "1.0.0"
44
description = "Kubernetes monitoring plugin"
55
authors = ["Robert Wikman <rwikman@op5.com>"]
66
license = "GPL-2.0"

0 commit comments

Comments
 (0)