function treeflow() {
local treeflow_path
local output
local code
treeflow_path="::treeflow_path::"
output=$($treeflow_path "$@")
code=$?
if [ $code -eq 0 ]; then
if [ -n "$output" ] && printf '%s' "$output" | grep -q '^Cd> '; then
local dir
dir=$(printf '%s' "$output" | sed -n 's/^Cd> \(.*\)$/\1/p')
cd "$dir"
return 0
fi
printf '%s\n' "$output"
return 0
fi
return $code
}