mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-18 22:27:51 +00:00
Add magic variable that stores the full command line invocation (#99)
Provides variable __invocation which contains the command line with proper separators maintained. Adapted from https://stackoverflow.com/a/36625791
This commit is contained in:
parent
ee869a9584
commit
327cba75c9
@ -20,6 +20,7 @@ Released: TBA.
|
||||
- [x] Change `egrep` to `grep -E` in test and lib scripts to comply with ShellCheck (#92, @gmasse)
|
||||
- [x] Fix typo in FAQ (#92, @gmasse)
|
||||
- [x] Fix Travis CI failure on src/templater.sh (@gmasse)
|
||||
- [x] Add magic variable which contains full command invocation
|
||||
|
||||
## v2.3.0
|
||||
|
||||
|
2
main.sh
2
main.sh
@ -47,7 +47,7 @@ fi
|
||||
__dir="$(cd "$(dirname "${BASH_SOURCE[${__b3bp_tmp_source_idx:-0}]}")" && pwd)"
|
||||
__file="${__dir}/$(basename "${BASH_SOURCE[${__b3bp_tmp_source_idx:-0}]}")"
|
||||
__base="$(basename "${__file}" .sh)"
|
||||
|
||||
__invocation="$(printf %q "${__file}")$((($#)) && printf ' %q' "$@")"
|
||||
|
||||
# Define the environment variables (and their defaults) that this script depends on
|
||||
LOG_LEVEL="${LOG_LEVEL:-6}" # 7 = debug -> 0 = emergency
|
||||
|
Loading…
Reference in New Issue
Block a user