If the function $f ( x ) = \left\{ \begin{array} { c l } \frac { \sqrt { 2 + \cos x } - 1 } { ( \pi - x ) ^ { 2 } } , & x \neq \pi \\ k , & x = \pi \end{array} \right.$ is continuous at $x = \pi$, then $k$ equals\\
(1) $\frac { 1 } { 4 }$\\
(2) 0\\
(3) 2\\
(4) $\frac { 1 } { 2 }$