Added version flag to hosto
This commit is contained in:
parent
4a49c99244
commit
ff02954482
@ -1,12 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
VERSION="0.1.0"
|
||||||
|
|
||||||
function help() {
|
function help() {
|
||||||
echo -e \
|
echo -e \
|
||||||
"Usage: $(basename $0) [OPTIONS]\n\n" \
|
"Usage: $(basename $0) [OPTIONS]\n\n" \
|
||||||
"Options:\n" \
|
"Options:\n" \
|
||||||
" -i, --inv-file <path> Specify the Ansible inventory to add.\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
|
if [[ $# -eq 0 ]]; then
|
||||||
@ -29,6 +31,10 @@ while [[ $# -gt 0 ]]; do
|
|||||||
help
|
help
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
-v|--version)
|
||||||
|
echo $VERSION
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
POSITIONAL_ARGS+=("$1")
|
POSITIONAL_ARGS+=("$1")
|
||||||
shift
|
shift
|
||||||
|
Loading…
x
Reference in New Issue
Block a user