aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcode-review9
-rw-r--r--doc/code-review.15
-rw-r--r--doc/code-review.1.txt3
3 files changed, 16 insertions, 1 deletions
diff --git a/code-review b/code-review
index a97df7a..d6ddab7 100755
--- a/code-review
+++ b/code-review
@@ -19,10 +19,12 @@
EX_USAGE=64
+VERSION=0.0.1
+
function print_usage () {
cat <<-EOF
- usage: code-review [--help] <command> [<args>]
+ usage: code-review [--help] [--version] <command> [<args>]
Commands:
@@ -50,6 +52,11 @@ if [ -z "$subcommand" ] || [ "$1" = '--help' ] || [ "$1" = '-h' ]; then
exit "$EX_USAGE"
fi
+if [ "$1" = '--version' ]; then
+ echo "$VERSION"
+ exit 0
+fi
+
if ! program_exists "${program}-${subcommand}"; then
echo >&2 "${program}: '${subcommand}' is not a ${program} command. See '${program} --help'"
exit "$EX_USAGE"
diff --git a/doc/code-review.1 b/doc/code-review.1
index e671bff..06b013b 100644
--- a/doc/code-review.1
+++ b/doc/code-review.1
@@ -41,6 +41,11 @@ A collection of tools that facilitate code review on the command line\&.
.RS 4
Print usage help\&.
.RE
+.PP
+\-\-version
+.RS 4
+Print the program version\&.
+.RE
.SH "COMMANDS"
.PP
changed\-files
diff --git a/doc/code-review.1.txt b/doc/code-review.1.txt
index 276399f..df2a087 100644
--- a/doc/code-review.1.txt
+++ b/doc/code-review.1.txt
@@ -18,6 +18,9 @@ OPTIONS
-h, --help::
Print usage help.
+--version::
+ Print the program version.
+
COMMANDS
--------
changed-files::