'Lists all versions for an app.'

def ListVersions(self):

    if (len(self.args) == 0):
        if (not self.options.app_id):
            self.parser.error('Expected    <directory>    argument    or    -A    <app    id>.')
        app_id = self.options.app_id
    elif (len(self.args) == 1):
        if self.options.app_id:
            self.parser.error('<directory>    argument    is    not    needed    with    -A.')
        appyaml = self._ParseAppInfoFromYaml(self.args[0])
        app_id = appyaml.application
    else:
        self.parser.error(('Expected    1    argument,    not    %d.' % len(self.args)))
    rpcserver = self._GetRpcServer()
    response = rpcserver.Send('/api/versions/list', app_id=app_id)
    parsed_response = yaml.safe_load(response)
    if (not parsed_response):
        print >>self.out_fh, ('No    versions    uploaded    for    app:    %s.' % app_id)
    else:
        print >>self.out_fh, response
