Fix bug when path is undefined.
Add -1/--onlyName mode to mirror `ls -1`