Rewrite work with command line arguments.