Why did pirates wear eye patches?

Society Trivia: Why did pirates wear eye patches?