Added version flag to hosto

This commit is contained in:
strNophix 2022-02-13 13:52:27 +01:00
parent 4a49c99244
commit ff02954482

View File

@ -1,12 +1,14 @@
#!/usr/bin/env bash
VERSION="0.1.0"
function help() {
echo -e \
"Usage: $(basename $0) [OPTIONS]\n\n" \
"Options:\n" \
" -i, --inv-file <path> Specify the Ansible inventory to add.\n" \
" -h, --help Show help.\n"
" -h, --help Show help.\n" \
" -v, --version Show version."
}
if [[ $# -eq 0 ]]; then
@ -29,6 +31,10 @@ while [[ $# -gt 0 ]]; do
help
exit 1
;;
-v|--version)
echo $VERSION
exit 1
;;
*)
POSITIONAL_ARGS+=("$1")
shift