added cmdline interface

not fully done, does not check for errors in command inputs yet. but
everything else works.