From 35f693ed103107de95f8082d5d2c9a2aed5334ac Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Fri, 4 Apr 2025 12:24:34 +0200 Subject: [PATCH] Fix. --- testing/home/desktop/.local/bin/borgplom | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testing/home/desktop/.local/bin/borgplom b/testing/home/desktop/.local/bin/borgplom index 6216f18..65350f1 100755 --- a/testing/home/desktop/.local/bin/borgplom +++ b/testing/home/desktop/.local/bin/borgplom @@ -17,17 +17,19 @@ path_repo_location() { printf '%s' "${PATH_BORG_CONF_SECURITY}/${1}/location"; } _print_usage() { echo "Usage: ${BIN_NAME} COMMAND" + echo "Usage: ${BIN_NAME} COMMAND TARGET" echo "Wrapper around certain borgbackup usages.\n" echo "Available commands:\n" + _var_of() { eval printf '"%s"' '"${'"${1}${2}"'}"'; } _build_index() { - _INDEX=" ${_CMD}$(eval printf '"%s"' '"${HELP_ARGS_'${_CMD}'}"')" - _LEN_INDEX=$(echo -n "${_INDEX}" | wc -c) + _INDEX=" ${_CMD}$(_var_of 'HELP_ARGS_' ${_CMD})" + _LEN_INDEX=$(echo -n "${_INDEX}" | wc -c) } _MAX_LEN_INDEX=0 for _CMD in ${COMMANDS}; do _build_index - if [ "${_LEN_INDEX}" -gt "${_MAX_LEN_INDEX}" ]; then + if [ "${_LEN_INDEX}" -gt "${_MAX_LEN_INDEX}" ]; then _MAX_LEN_INDEX="${_LEN_INDEX}" fi done @@ -35,10 +37,10 @@ _print_usage() { _build_index printf '%s' "${_INDEX}" _LEN_GAP=$(calc "${_MAX_LEN_INDEX} - ${_LEN_INDEX} + 2") - for _ in $(seq 1 ${_LEN_GAP}); do + for _ in $(seq 1 ${_LEN_GAP}); do printf ' ' done - eval printf '"%s\n"' '"${HELP_DESC_'${_CMD}'}"' + printf '%s\n' "$(_var_of 'HELP_DESC_' ${_CMD})" done } @@ -175,7 +177,7 @@ CMDFNC_orgpull() { done < "${_PATH_PIPE}" rm "${_PATH_PIPE}" if [ -z "${_REPO}" ]; then - error_exit "no repo being available." + error_exit 'no repo being available.' fi # determine passphrase and archive @@ -207,7 +209,7 @@ CMDFNC_orgpull() { # parse args to execution if [ "$#" -lt 1 ]; then - error_exit_with_usage "missing command." + error_exit_with_usage 'missing command.' fi for CMD in ${COMMANDS}; do if [ "$1" = "${CMD}" ]; then -- 2.30.2