run-tree: make pure function
main: handle command-line options