Added help flag to hosto

This commit is contained in:
strNophix 2022-02-13 13:47:42 +01:00
parent 54b88dedb9
commit 4a49c99244

View File

@ -1,5 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
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"
}
if [[ $# -eq 0 ]]; then
help
exit 1
fi
POSITIONAL_ARGS=() POSITIONAL_ARGS=()
INVENTORY_FILE="$(pwd)/inventory" INVENTORY_FILE="$(pwd)/inventory"
@ -10,8 +25,8 @@ while [[ $# -gt 0 ]]; do
shift shift
shift shift
;; ;;
-*|--*) -h|--help)
echo "hosto: Unknown option $1" help
exit 1 exit 1
;; ;;
*) *)