Origin of the term "fly" (in reference to pants or underwear)

Where did the term “fly” in this context come about? I checked Wikipedia, and it gave a history of the pants feature, but it did not say where the term came from.

For what it’s worth, pants used to be pulled down for “sanitary” functions, then later came the codpiece, which evolved in to an attached front, which evolved in to the fly.

The OED says it comes from “flap”:

“Cf.” does not mean “comes from”: it means “compare”. “Fly” in this sense comes from the verb “fly”. (There’s another English noun “fly”, which means a kind of insect.)

Oddly enough, if you are discussing western Europe, the progression sort of went trews for celts and roman soldiers, scythians and a few assorted other groups to hose held to a belt with points and laces with a cod around 700 or so, with the cod being more of a plain flap almost like a thong. Trews and trunk hose came back much later mainly for the peasant class until after about the 1650s or so - peasants not really having the time or money to play fancy with dressing. Noneuropeans still had trews in one form or another, but generally are not considered for western european clothing styles =) Actually many steppes types used chaps over trews when riding - softer linen or silk trews and heavier woolen and leather chaps. I have a set of chaps that I am making that match a del and braidcase, but it really doesn’t get cold enogh for me to wear them to an SCA event, it really calls for that cold steppes wind that you get coming down out of Canada and hitting Chicago in January =) and Connecticut really doesn’t get winter most years.