Commit 268b3a53 authored by Vincent Pelletier's avatar Vincent Pelletier

shell: Add --version support.

parent a9e2c64f
caucase/_version.py export-subst caucase/_version.py export-subst
shell/caucase.sh export-subst
...@@ -749,7 +749,7 @@ EOF ...@@ -749,7 +749,7 @@ EOF
status arg argc \ status arg argc \
ca_netloc ca_address ca_port ca_path \ ca_netloc ca_address ca_port ca_path \
csr_id csr csr_path crl crt crt_path crt_dir key_path key serial \ csr_id csr csr_path crl crt crt_path crt_dir key_path key serial \
csr_list_json csr_list_json version
while test $# -gt 0; do while test $# -gt 0; do
arg="$1" arg="$1"
...@@ -760,6 +760,19 @@ EOF ...@@ -760,6 +760,19 @@ EOF
_usage _usage
return return
;; ;;
--version)
# shellcheck disable=SC2016
version='$Format:%H$'
if [ "x$(echo "$version" | base64)" = 'xJEZvcm1hdDolSCQK' ]; then
if command -v git > /dev/null; then
version="$(git describe --tags --dirty --always --long)"
else
version='unknown'
fi
fi
printf '%s\n' "$version"
return
;;
--ca-url) --ca-url)
_needArg 1 || return 1 _needArg 1 || return 1
ca_anon_url="$1" ca_anon_url="$1"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment