The accused shall be named as defendant, and the petition or complaint, except when filed upon the relation of the law officers of the state, district, county, or municipality, shall be verified by oath or affidavit, shall state the charges against defendant, with reasonable certainty, and be subject to amendment as in other actions.