Writes the hook command and uses choice for some option parsing.