Converts RAW/NEF/CR2 files into linear TIFF files, using GNU Parallel for maximum speed. Other features: B/W grayscaling, TIF resizing and ZIP compression.
So this script is refactored to a main function and some helper functions as well. Nice. All of them on the global level. Not so nice, as the code blocks are not self-containing any longer.
To make sure everything is self-containing again and to prepare for unit testing, all functions should receive the stuff they need as parameter.
function Foo {
echo "Foo!"
}
function main {
local local_foo=$1
shift
# Call dependency. Output should be "Foo!"
($local_foo)
}
main Foo "${@}"
So this script is refactored to a main function and some helper functions as well. Nice. All of them on the global level. Not so nice, as the code blocks are not self-containing any longer.
To make sure everything is self-containing again and to prepare for unit testing, all functions should receive the stuff they need as parameter.