]> arthur.barton.de Git - ax-zsh.git/blobdiff - bin/axzshctl
axzshctl: Add --version
[ax-zsh.git] / bin / axzshctl
index f8716fd08f446006686993d540b9574a20c0dfe0..d0eca718904f16b6da8d7d92ad4b577987972462 100755 (executable)
@@ -21,6 +21,19 @@ if [[ -z "$ax_common_sourced" ]]; then
 fi
 unset dir ax_common ax_common_sourced
 
 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 <alex@barton.de>."
+       echo "Licensed under the terms of the MIT license, see LICENSE.md for details."
+       echo "Homepage: <https://github.com/alexbarton/ax-zsh>"
+       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 <command> [...]"
        echo
 function Usage {
        echo "Usage: $NAME <command> [...]"
        echo
@@ -437,6 +450,9 @@ case "$cmd" in
                [[ $# -eq 0 ]] || Usage
                UpdatePluginCache -v
                ;;
                [[ $# -eq 0 ]] || Usage
                UpdatePluginCache -v
                ;;
+       "--version"|"version")
+               Version >&2
+               ;;
        "--help"|"help")
                Usage >&2
                ;;
        "--help"|"help")
                Usage >&2
                ;;