Implement flexible target specification

See commit message.
status => output