Fix use of errors in various commands

Some used errors but didn’t import the error module; others _vice
versa_.

One was throwing a generic error instead of a CommandLineError.