make defaults configurable
This commit is contained in:
@@ -204,6 +204,15 @@ utaz()
|
||||
local FILES=("$@")
|
||||
[[ ${#FILES[@]} -eq 0 ]] && FILES=(".")
|
||||
|
||||
# Apply defaults from [compress] configuration if not overridden by flags
|
||||
[[ -z ${willrm+x} ]] && [[ ${UTAZ_DEFAULT_DELETE:-0} -eq 1 ]] && willrm=1
|
||||
if [[ -z ${createdir+x} && -z ${nodir+x} ]]; then
|
||||
case "${UTAZ_DEFAULT_DIR_MODE:-auto}" in
|
||||
always) createdir=1 ;;
|
||||
never) nodir=1 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
[[ -n ${createdir} && -n ${nodir} ]] && \
|
||||
disp E "The --create-dir and --no-dir options are mutually exclusive."
|
||||
|
||||
@@ -565,9 +574,9 @@ taz()
|
||||
local FILES=("$@")
|
||||
[[ ${#FILES[@]} -eq 0 ]] && FILES=(".")
|
||||
|
||||
[[ ! $compform ]] && compform=lz # safe and efficient (unless data are already compressed)
|
||||
[[ ! $nproc ]] && nproc=1
|
||||
[[ ! $complevel ]] && complevel=6
|
||||
[[ ! $compform ]] && compform=${TAZ_DEFAULT_FORMAT:-lz}
|
||||
[[ ! $nproc ]] && nproc=${TAZ_DEFAULT_THREADS:-1}
|
||||
[[ ! $complevel ]] && complevel=${TAZ_DEFAULT_LEVEL:-6}
|
||||
[[ $verbose -gt 1 && $quiet -gt 1 ]] &&
|
||||
disp E "The --verbose and --quiet options can't be used together."
|
||||
|
||||
@@ -619,4 +628,6 @@ export -f taz
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
load_conf "compress"
|
||||
|
||||
# EOF
|
||||
|
||||
Reference in New Issue
Block a user