aws/aws-cli — pull request #455 by jamesls (2013-10-30 20:08:05+00:00)
Title: Add a "configure" top level command

This command will allow a user to be interactively prompted for values:

```
$ aws configure
AWS Access Key ID [****************]: accesskey
AWS Secret Access Key [****************]: secretkey
Default region name [us-west-2]: us-west-2
Default output format [None]: json
```

This will automatically create an `~/.aws/config` file and write out the
values to this file. This can also be used to update existing values.
If you run the `configure` command with existing values then the current
value will be provided in `[brackets]`, you can hit enter to accept the
current value or provide a new value.

You can also provide a `--profile` arg to update/create a profile.

Care was taken to *not* touch any unchanged data on updates. This means
we don't just simply load the parsed config data, manipulate it, the use
ConfigParser to write out the new data. This would lose the existing
formatting of the file as well as any comments in the config file.
If I have a config file like this:

```
aws_access_key_id = myaccesskey
aws_secret_access_key = secretkey
; Here's a comment.

# Here's a nother comment.
; And another comment
output = text ; Use text output instead of json
region = us-west-1
```

And I run `aws configure` and only enter a value for *just* the region, then
only the region line will be changed. All the existing comments will be
preserved.

Internal Changes
================

Part of this change is the introduction of a `BasicCommand` class that
makes it much easier to create top level commands. It supports:

* Defining documentation on the command object
* Defining an argument table on the command object
* Automatically managing the argparse creation
* Automatically providing a "help" command

It doesn't support subcommands (mostly because the "configure" command
doesn't have any right now), but I do plan on adding support for
subcommands.

When this means for plugin writers is that you only have to define a
single class to create a new to level command.

This required some small changes to `bcdoc` related to pulling up the
synopsis/option handlers into the base handler class so that we can have
the same look and feel as built the arguments for built in operations.