add "directory" option

Closes #4.