adds test for command line and uses callback for error