Use Argparse subcommands for commands

Put all info on commands into a "cmds" data structure, and then use that
to register subcommands for everything.

Set self.func to the function we should call based upon the convention
that the method is named the same as the command, but perhaps with '_'s
instead of '-'s. This required some methods to be renamed to match.

Signed-off-by: Andy Grover <agrover@redhat.com>
Remove stuff we don't need any more

All command args are now associated with their applicable subcommand.

_cmds, and _validate should no longer be needed to validate input.

Signed-off-by: Andy Grover <agrover@redhat.com>
Remove unused stuff
Change stuff to use new parsing and method calling style

All functions associated with subcommands take (self, args).
Instead of these functions looking at self.cmd_value and self.args,
all arguments are in args parameter.

cli() is made into a member method.

Signed-off-by: Andy Grover <agrover@redhat.com>
Make _get_item throw an ArgError if id not found

Since every caller was checking the return value and then throwing the
exception if None, we can just throw from _get_item and save some code.

We also add a friendly_name parameter so we can have a customized exception
message.

Signed-off-by: Andy Grover <agrover@redhat.com>
Remove unneeded documentation of what "self" param is

Signed-off-by: Andy Grover <agrover@redhat.com>
Fix up replicate_volume_range

Clarified some logic that might be confusing. Raise an exception if
argument counts don't match. Flag arguments as 'append'.

Signed-off-by: Andy Grover <agrover@redhat.com>
Customize --help output

Unless we give add_subparser a metavar, it uses a concatenation of all
subcommands, which is not attractive. Other parameters don't seem to be
needed so remove them, and put the description for the main parser
in the instantiation instead of afterwards.

Signed-off-by: Andy Grover <agrover@redhat.com>
Allow both upper and lowercase for types

Because we're on Unix and should allow lowercase if possible.

Improve the command list walking to pass kwargs more easily.

Signed-off-by: Andy Grover <agrover@redhat.com>