Add a version number and version command

This commit is contained in:
Jérémy Lecour 2020-05-04 17:43:09 +02:00 committed by Jérémy Lecour
parent 536de976cc
commit 48b282c2df
2 changed files with 29 additions and 0 deletions

View file

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
* Create a changelog
* Add a version number and `version` command
### Changed

View file

@ -5,6 +5,29 @@
set -e
VERSION="1.0.0"
show_version() {
cat <<END
shellpki version ${VERSION}
Copyright 2010-2019 Evolix <info@evolix.fr>,
Thomas Martin <tmartin@evolix.fr>,
Gregory Colpart <reg@evolix.fr>,
Romain Dessort <rdessort@evolix.fr>,
Benoit Série <bserie@evolix.fr>,
Victor Laborie <vlaborie@evolix.fr>,
Daniel Jakots <djakots@evolix.fr>,
Patrick Marchand <pmarchand@evolix.fr>,
Jérémy Lecour <jlecour@evolix.fr>
and others.
shellpki comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
See the MIT Licence for details.
END
}
init() {
umask 0177
@ -551,6 +574,11 @@ main() {
check "$@"
;;
version)
show_version
exit 0
;;
*)
usage >&2
exit 1