code: func Print(tasks []*api.Task, all bool, res *common.Resolver) {
  	w := tabwriter.NewWriter(os.Stdout, 4, 4, 4, ' ', 0)
  	defer w.Flush()
  
  	common.PrintHeader(w, "Task ID", "Service", "Slot", "Image", "Desired State", "Last State", "Node")
  	sort.Stable(tasksBySlot(tasks))
  	for _, t := range tasks {
  		if !all && t.DesiredState > api.TaskStateRunning {
  			continue
  		}
  		c := t.Spec.GetContainer()
  		fmt.Fprintf(w, "%s\t%s\t%d\t%s\t%s\t%s %s\t%s\n",
  			t.ID,
  			t.ServiceAnnotations.Name,
  			t.Slot,
  			c.Image,
  			t.DesiredState.String(),
  			t.Status.State.String(),
  			common.TimestampAgo(t.Status.Timestamp),
  			res.Resolve(api.Node{}, t.NodeID),
  		)
  	}
  }
docs: // Print prints a list of tasks.