<commit_before>package cmd

import (
	"fmt"
	"log"
	"os"

	"golang.org/x/net/context"

	"github.com/codegangsta/cli"
	"github.com/olekukonko/tablewriter"
)

var cmdZonesList = cli.Command{
	Name:  "list",
	Usage: "lists zones",
	Flags: []cli.Flag{
		cli.BoolFlag{
			Name:  "list",
			Usage: "if true only prints ids",
		},
	},
	Action: func(c *cli.Context) {
		zones, err := client(c).Zones.List(context.Background())
		if err != nil {
			log.Fatal(err)
		}

		table := tablewriter.NewWriter(os.Stdout)
		table.SetHeader([]string{
			"ID",
			"Name",
			"Paused",
			"Status",
		})

		for _, zone := range zones {
			if c.Bool("list") {
				fmt.Println(zone.ID)
			} else {
				table.Append([]string{
					zone.ID,
					zone.Name,
					yesOrNo(zone.Paused),
					zone.Status,
				})
			}
		}

		if !c.Bool("list") {
			table.Render()
		}
	},
}<commit_msg>Flag for listing zones domains<commit_after>package cmd

import (
	"fmt"
	"log"
	"os"

	"golang.org/x/net/context"

	"github.com/codegangsta/cli"
	"github.com/olekukonko/tablewriter"
)

var cmdZonesList = cli.Command{
	Name:  "list",
	Usage: "lists zones",
	Flags: []cli.Flag{
		cli.BoolFlag{
			Name:  "list",
			Usage: "if true only prints ids",
		},
		cli.BoolFlag{
			Name:  "domains",
			Usage: "(only with --list) if true only prints domains",
		},
	},
	Action: func(c *cli.Context) {
		zones, err := client(c).Zones.List(context.Background())
		if err != nil {
			log.Fatal(err)
		}

		table := tablewriter.NewWriter(os.Stdout)
		table.SetHeader([]string{
			"ID",
			"Name",
			"Paused",
			"Status",
		})

		for _, zone := range zones {
			if c.Bool("list") {
				if c.Bool("domains") {
					fmt.Println(zone.Name)
				} else {
					fmt.Println(zone.ID)
				}
			} else {
				table.Append([]string{
					zone.ID,
					zone.Name,
					yesOrNo(zone.Paused),
					zone.Status,
				})
			}
		}

		if !c.Bool("list") {
			table.Render()
		}
	},
}
{'fraction_non_alphanumeric': 0.1789087093389297, 'fraction_numerical': 0.0, 'mean_word_length': 2.7173489278752436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4086378', 'n_tokens_mistral': 924, 'n_tokens_neox': 762, 'n_words': 142}