aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.bash_utils/cxx.sh
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-04-16 02:18:51 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-04-16 02:18:51 +0300
commit4124f35044b810719c6aae8d3ca148f927482e46 (patch)
tree8f1289edce2a8da152e6bd1518745a28dbbeff6f /%HOME%/.bash_utils/cxx.sh
parentsums_list_paths: factor out sums_unescape_path (diff)
downloadlinux-home-4124f35044b810719c6aae8d3ca148f927482e46.tar.gz
linux-home-4124f35044b810719c6aae8d3ca148f927482e46.zip
bugfix & code style
Diffstat (limited to '%HOME%/.bash_utils/cxx.sh')
-rw-r--r--%HOME%/.bash_utils/cxx.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/%HOME%/.bash_utils/cxx.sh b/%HOME%/.bash_utils/cxx.sh
index 4e332e7..633e154 100644
--- a/%HOME%/.bash_utils/cxx.sh
+++ b/%HOME%/.bash_utils/cxx.sh
@@ -25,12 +25,15 @@ runcxx_compiler=g++
_runc_usage() (
set -o errexit -o nounset -o pipefail
+ local prefix="${FUNCNAME[0]}"
+ [ "${#FUNCNAME[@]}" -gt 1 ] && prefix="${FUNCNAME[1]}"
+
local msg
for msg; do
- echo "${FUNCNAME[1]}: $msg"
+ echo "$prefix: $msg"
done
- echo "usage: ${FUNCNAME[1]} [-h|--help] [-c|--comp-arg ARG]... C_PATH... [-- [PROG_ARG]...]"
+ echo "usage: $prefix [-h|--help] [-c|--comp-arg ARG]... C_PATH... [-- [PROG_ARG]...]"
)
runc() (
@@ -103,12 +106,15 @@ runc() (
_runcxx_usage() (
set -o errexit -o nounset -o pipefail
+ local prefix="${FUNCNAME[0]}"
+ [ "${#FUNCNAME[@]}" -gt 1 ] && prefix="${FUNCNAME[1]}"
+
local msg
for msg; do
- echo "${FUNCNAME[1]}: $msg"
+ echo "$prefix: $msg"
done
- echo "usage: ${FUNCNAME[1]} [-h|--help] [-c|--comp-arg ARG]... CPP_PATH... [-- [PROG_ARG]...]"
+ echo "usage: $prefix [-h|--help] [-c|--comp-arg ARG]... CPP_PATH... [-- [PROG_ARG]...]"
)
runcxx() (