improve command_done() API and docs