Added command line support. (Thanks to Magnus)