       @create container, done
 
     start: (done) ->
-      [container] = @args
-      @start container, done
+      [cluster] = @args
+      @start cluster, done
 
     stop: (done) ->
       [container] = @args


    @config = @loadConfig "./decking.json"

  parseConfig: (data) -> JSON.parse data

  loadConfig: (file) ->
    log "Loading package file..."
    @parseConfig fs.readFileSync file

  commands:
    build: (done) ->

        process.stdout.write stdout
        done()

  start: (cluster, done) ->
    throw new Error "Please supply a cluster to start" if not cluster

    target = @config.clusters[cluster]

    throw new Error "Cluster #{cluster} does not exist in decking.json"  if not target

    log "Resolving dependencies for cluster #{cluster}"

    resolveOrder @config, target, (list) ->

      async.eachSeries list, (details, callback) ->
        name = details.name
        container = docker.getContainer name
        container.inspect (err, data) ->
          if not data.State.Running
            log "Starting container #{name}"
            container.start callback
          else
            log "Container #{name} already running..."
            callback null
      , done


  stop: (container, done) ->
    throw new Error("Please supply a container to stop") if not container
