printMainData() {
echo "printMainData"
}
printOtherData() {
echo "printOtherData"
}
#return without a number keeps the exit code of the last command;
#here it is the code of [[ ]], which was true, so 0
printSomeData() {
local printAll=$1
printMainData
if [[ $printAll != true ]]; then
return
fi
printOtherData
}
printSomeData false
#prints "printMainData"
printSomeData true
#prints "printMainData"
#and "printOtherData"