From 2a37479d60e76aedb83a494d00d872c1255ae1cd Mon Sep 17 00:00:00 2001 From: Vladimir Zhelezov Date: Sat, 19 Dec 2020 13:16:23 +0100 Subject: [PATCH] Revert "Do not use `set -e` in helper shell scripts" This reverts commit 0aeb88e663b9b19e173de20b132bef2189c6d7c9. --- shell-completion/parse-commands.sh | 4 ++-- shell-completion/parse-options.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shell-completion/parse-commands.sh b/shell-completion/parse-commands.sh index 19b5571d9..1ced05a77 100755 --- a/shell-completion/parse-commands.sh +++ b/shell-completion/parse-commands.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash # Parse hledger's help and output all commands and command aliases in # parenthesis. Do not output single letter command aliases, it's not useful. -set -uo pipefail +set -euo pipefail declare commands_help -commands_help=$(hledger) || exit +commands_help=$(hledger) { sed -rn 's/^\s+([a-z][-a-z]+)\s+.*/\1/p' <<< "$commands_help" sed -rn 's/^\s+[a-z][-a-z]+\s+\(([a-z][ ,a-z]+)\).*/\1/p' <<< "$commands_help" | diff --git a/shell-completion/parse-options.sh b/shell-completion/parse-options.sh index 80e0f6953..7d7636906 100755 --- a/shell-completion/parse-options.sh +++ b/shell-completion/parse-options.sh @@ -2,7 +2,7 @@ # Parse hledger's help and output long options. Do not propose single letter # completions. Options requiring an argument make that explicit by appending the # equal sign (=) -set -uo pipefail +set -euo pipefail declare subcommand=${1:-} declare hledgerArgs=(--help)