From c96d30a4a276a5b9489a88dde557e129329d2e48 Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Tue, 16 Jan 2024 12:11:31 +0100 Subject: [PATCH] fix: help option for port forwarder --- salt/sys-syncthing/files/admin/firewall/qvm-port-forward | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/salt/sys-syncthing/files/admin/firewall/qvm-port-forward b/salt/sys-syncthing/files/admin/firewall/qvm-port-forward index 62f64417..c4224f1d 100644 --- a/salt/sys-syncthing/files/admin/firewall/qvm-port-forward +++ b/salt/sys-syncthing/files/admin/firewall/qvm-port-forward @@ -243,12 +243,15 @@ hook_dir="/rw/config/network-hooks.d" hook_prefix="${hook_dir}/90-port-forward-" persistent="" -if ! OPTS=$(getopt -o a:q:p:n:s --long action:,qube:,port:,proto:,persistent -n "${0}" -- "${@}"); then +if ! OPTS=$(getopt -o h,a:q:p:n:s --long help,action:,qube:,port:,proto:,persistent -n "${0}" -- "${@}"); then echo "An error occurred while parsing options." >&2 exit 1 fi eval set -- "${OPTS}" +if test "${OPTS}" = " --"; then + usage +fi while test "${#}" -gt "0"; do case "${1}" in -a|--action) action="${2}"; shift;; @@ -256,6 +259,7 @@ while test "${#}" -gt "0"; do -p|--port) port="${2}"; shift;; -n|--proto) proto="${2}"; shift;; -s|--persistent) persistent=1; shift;; + -h|--help) usage;; esac shift done