Advanced help output showing actual paths before step start

This commit is contained in:
2020-01-13 18:12:02 +01:00
parent 60f6d04c3b
commit 0cded7c888

View File

@@ -40,10 +40,38 @@ step_1() {
} }
step_3_info() { step_3_info() {
echo "Backup [OPTION] <DIRECTORY> <TARGET> [EXCLUDES...]" # Backup single directory recursively
echoinfo "Exclude path notation starts within DIRECTORY." local opt="[OPTION]"
echoinfo "e.g. to exclude DIRECTORY/a:" local dir="<DIRECTORY>"
echoinfo " $0 budir DIRECTORY TARGET /a" local tar="<TARGET>"
local exc="[EXCLUDES...]"
shift
if [ "$1" == "-t" ] ; then
opt=" -t "
tar=
shift
fi
if [ ! -z "$1" ] ; then
dir="$1"
shift
if [ ! -z $tar ] && [ ! -z "$1" ] ; then
tar="$1"
shift
else
tar="$BACKUP_TARGET"
fi
if [ ! -z "$1" ] ; then
exc="$@"
else
exc="[NO EXCLUDES]"
fi
fi
echo "Backup $opt $dir $tar $exc"
echoinfo " -t : Using configuration value as TARGET"
echoinfo " <DIRECTORY> [EXCLUDES...]"
echoinfo "EXCLUDES path notation starts within $dir"
echoinfo "e.g. to exclude $dir/a:"
echoinfo " $0 budir $dir $tar /a"
} }
step_3_alias() { ALIAS="budir"; } step_3_alias() { ALIAS="budir"; }
step_3() { step_3() {