check error results in advance_record
added better command line handling; support predefined patterns