add commandline support (fix #31)