aws/aws-cli — pull request #122 by jamesls (2013-05-17 22:21:58+00:00)
Title: Add support for shorthand (non JSON) complex parameters

This Pull Request adds support for an alternate syntax to JSON for *some* of
the complex parameters. It cover the 80% case and can accomodate the
most common complex shapes. The shorthand syntax is essentially `key=value`
where key and value can be unquoted. In some cases, value can also be a
comma separated list (all unquoted). The implemented syntax includes:

* Structure of scalar values (
`--source-configuration application_name=foo,template_name=bar`)
* List of structure with a single scalar value (
`--instance-ids id-1 id-2 id-3`)
* List of structures with scalar and list of scalars (EC2 filters):
`--filters name=instance-id,values=id-1,id-2,id-3`
* Map of scalars (`--attributes VisibilityTimeout=15`)

The syntax is an optional syntax, the existing JSON syntax will still
work for these shapes if a user prefers, so a user shouldn't have
to change existing code.

I've also integrated doc generation so that the `help` command will
automatically have this shorthand syntax injected into the man/text pages.

There's also reasonable error messages:

```
# Syntax error
$ aws ec2 describe-instances --filters names:instance-id,values=instance-1
Error parsing parameter --filters, should be: --filters name=name1,values=values1,values2,name=name2,values=values1

# Wrong key name
$ aws ec2 describe-instances --filters namess=instance-id,values=instance-1
Unknown key 'namess' for parameter --filters, valid choices are: values, name
```

It's fairly straightforward to add support for more of these shapes,
and I think we can probably add more shapes in the near future.

cc @garnaat @toastdriven