From bc5227bc5d2cf74a3740b7724d3a3ea423737829 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 12 Jun 2020 00:01:05 +0200 Subject: [PATCH] axzshctl: Add --version --- bin/axzshctl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/axzshctl b/bin/axzshctl index f8716fd..d0eca71 100755 --- a/bin/axzshctl +++ b/bin/axzshctl @@ -21,6 +21,19 @@ if [[ -z "$ax_common_sourced" ]]; then fi unset dir ax_common ax_common_sourced +function Version { + echo "ax-zsh -- Modular configuration system for the Z shell (ZSH)" + echo "Copyright (c) 2015-2019 Alexander Barton ." + echo "Licensed under the terms of the MIT license, see LICENSE.md for details." + echo "Homepage: " + if [[ -d "$AXZSH/.git" && -n "$commands[git]" ]]; then + echo -n "Version: Git ID " + ( cd "$AXZSH" && git describe --always ) + fi + echo + exit 0 +} + function Usage { echo "Usage: $NAME [...]" echo @@ -437,6 +450,9 @@ case "$cmd" in [[ $# -eq 0 ]] || Usage UpdatePluginCache -v ;; + "--version"|"version") + Version >&2 + ;; "--help"|"help") Usage >&2 ;; -- 2.39.2