Complete main of dirname.py