tricky implement of format print
command line tool