The rules about pleading and procedure in mandamus apply to actions for quo warranto as near as may be.