From 00495ddf251cd790b6045b12ee0afa0f81c694bb Mon Sep 17 00:00:00 2001 From: Bryan Gardiner Date: Sun, 16 May 2021 17:07:05 -0700 Subject: [PATCH] Add the program version via 'nvd --version' and the man page. --- src/nvd | 8 ++++++++ src/nvd.1 | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nvd b/src/nvd index d551bc7..11d65ae 100755 --- a/src/nvd +++ b/src/nvd @@ -48,6 +48,8 @@ from pathlib import Path from subprocess import PIPE from typing import Dict, List, Optional, Tuple, Union +NVD_VERSION = "0.1.0" + USE_COLOUR = False SGR_RESET = 0 @@ -588,6 +590,12 @@ def parse_args(): epilog="See the nvd(1) manual page for more information.", ) + parser.add_argument( + "--version", + action="version", + version=f"nvd {NVD_VERSION}", + ) + parser.add_argument( "--color", default="auto", diff --git a/src/nvd.1 b/src/nvd.1 index 8c68756..1b4f7b5 100644 --- a/src/nvd.1 +++ b/src/nvd.1 @@ -1,4 +1,4 @@ -.TH nvd 1 2021-05-16 nvd "User Commands" +.TH nvd 1 2021-05-16 nvd-0.1.0 "User Commands" .SH NAME nvd \- Nix/NixOS package version diff tool .SH SYNOPSIS