ovs-appctl-compgen: Refine the code based on review.

Received valuable reviews from Peter Amidon, refine the
code accordingly.

Signed-off-by: Yeqiao Wang <ee07b291@gmail.com>