Support the login command

We can implement command that require arguments now when we parse the
command line. Implement support for the login command where a username
and password is required.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
Ask for missing command arguments

All arguments are required on the command line. But the user may not
want to write all of them on the command line. A password can for
example be asked for separately using a method where the actual text is
hidden.

Use arguments if they are available. Ask for them using the prompt
otherwise.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
Handle expected tagged reply in separate function

The indentation level is too high in on_tagged. Move the actual handling
of the reply to a separate set of functions and call them instead of
just adding extra indentation.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
Print message if expected reply is not ok

When a tagged reply is expected to arrive it should be of the OK type.
If it's not then something went bad. Check if that has happened and
print the text with the hope that it explains the problem.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>