can you make search_file_replace_line (and all the rest of the commands) return false if it does no edits even if hosts.unwritten_changes? is already true by a previous statement?

in other words, yes to the last idea there, but make sure the return value reflects the changes that the statement made or not.

stretch goal, though -- i'd be happy with just dropping it if it makes the code more complicated.