Why did pirates wear eye patches?

Why did pirates wear eye patches?