Only generate the cmd functions when the link is clicked