upgrade of line command for multiple options and better handling of errors