Improve command-line parsing and add a manpage

Signed-off-by: David Scott <dave.scott@citrix.com>