Close securely, fasten, as in The house was all buttoned up, or Button up your coat—it's very cold. [Late 1500s]
Also,
button one's lip. Hold one's tongue, keep quiet. For example, Please button your lip about the surprise. A variant of this usage,
button one's mouth, dates from the 17th century. [Mid-1800s]
Finish successfully, as in I've got this report all buttoned up. [c. 1940]