refactor redundant code around calls to cmd.Parse

Signed-off-by: Tibor Vass <teabee89@gmail.com>