aboutsummaryrefslogtreecommitdiff
path: root/prometheus_pgbouncer_exporter/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'prometheus_pgbouncer_exporter/cli.py')
-rw-r--r--prometheus_pgbouncer_exporter/cli.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/prometheus_pgbouncer_exporter/cli.py b/prometheus_pgbouncer_exporter/cli.py
index f0807ce..acadd6f 100644
--- a/prometheus_pgbouncer_exporter/cli.py
+++ b/prometheus_pgbouncer_exporter/cli.py
@@ -22,6 +22,7 @@ from os.path import join, dirname, normpath
from http.server import HTTPServer
from prometheus_client.core import REGISTRY
+from . import __version__
from .utils import get_connection
from .exposition import create_request_handler
from .collectors import StatsCollector, ListsCollector, PoolsCollector, \
@@ -36,6 +37,12 @@ def main():
)
p.add(
+ '--version',
+ action='store_true',
+ help="Show the version",
+ )
+
+ p.add(
'-c',
'--config',
is_config_file=True,
@@ -71,6 +78,10 @@ def main():
options = p.parse_args()
+ if options.version:
+ print("prometheus-pgbouncer-exporter %s" % __version__)
+ return
+
logging.basicConfig(level=logging.DEBUG)
logging.info(p.format_values())