<commit_before>package main

import (
	"log"

	"fmt"

	"github.com/codegangsta/cli"
	"github.com/kyokomi/appConfig"
	"github.com/kyokomi/scan"
	"github.com/skratchdot/open-golang/open"
)

const accessTokenUrl = "https://kyokomi-oauth2.herokuapp.com/access"

var ac *appConfig.AppConfig

var Commands = []cli.Command{
	commandAdd,
	commandList,
	commandDeleteConfig,
}

var commandAdd = cli.Command{
	Name:  "add",
	Usage: "",
	Description: `
`,
	Flags: []cli.Flag{
		cli.StringFlag{ Name: "path", Value: "", Usage: "", EnvVar: "" },
	},
	Action: doAdd,
}

var commandList = cli.Command{
	Name:  "list",
	Usage: "",
	Description: `
`,
	Action: doList,
}

var commandDeleteConfig = cli.Command{
	Name:  "delete-config",
	Usage: "",
	Description: `
`,
	Action: doDeleteConfig,
}

func doAdd(c *cli.Context) {
	ac = appConfig.NewAppConfig(c.App.Name)
	t, err  := readAccessToken()
	if err != nil {
		log.Fatal(err)
	}

	d := NewDropBox(t)
	if err := d.SetupCache(ac.ConfigDirPath); err != nil {
		log.Fatal(err)
	}

	filePath := c.String("path")
	if err := d.AddImage(filePath); err != nil {
		log.Fatal(err)
	}
}

func doList(c *cli.Context) {
	ac = appConfig.NewAppConfig(c.App.Name)
	t, err  := readAccessToken()
	if err != nil {
		log.Fatal(err)
	}

	d := NewDropBox(t)
	if err := d.SetupCache(ac.ConfigDirPath); err != nil {
		log.Fatal(err)
	}

	l, err := d.ReadImageList()
	if err != nil {
		log.Fatal(err)
	}<commit_msg>style: goimports<commit_after>package main

import (
	"log"

	"fmt"

	"github.com/codegangsta/cli"
	"github.com/kyokomi/appConfig"
	"github.com/kyokomi/scan"
	"github.com/skratchdot/open-golang/open"
)

const accessTokenUrl = "https://kyokomi-oauth2.herokuapp.com/access"

var ac *appConfig.AppConfig

var Commands = []cli.Command{
	commandAdd,
	commandList,
	commandDeleteConfig,
}

var commandAdd = cli.Command{
	Name:  "add",
	Usage: "",
	Description: `
`,
	Flags: []cli.Flag{
		cli.StringFlag{Name: "path", Value: "", Usage: "", EnvVar: ""},
	},
	Action: doAdd,
}

var commandList = cli.Command{
	Name:  "list",
	Usage: "",
	Description: `
`,
	Action: doList,
}

var commandDeleteConfig = cli.Command{
	Name:  "delete-config",
	Usage: "",
	Description: `
`,
	Action: doDeleteConfig,
}

func doAdd(c *cli.Context) {
	ac = appConfig.NewAppConfig(c.App.Name)
	t, err := readAccessToken()
	if err != nil {
		log.Fatal(err)
	}

	d := NewDropBox(t)
	if err := d.SetupCache(ac.ConfigDirPath); err != nil {
		log.Fatal(err)
	}

	filePath := c.String("path")
	if err := d.AddImage(filePath); err != nil {
		log.Fatal(err)
	}
}

func doList(c *cli.Context) {
	ac = appConfig.NewAppConfig(c.App.Name)
	t, err := readAccessToken()
	if err != nil {
		log.Fatal(err)
	}

	d := NewDropBox(t)
	if err := d.SetupCache(ac.ConfigDirPath); err != nil {
		log.Fatal(err)
	}

	l, err := d.ReadImageList()
	if err != nil {
		log.Fatal(err)
	}
{'fraction_non_alphanumeric': 0.17527221636810678, 'fraction_numerical': 0.0007024938531787847, 'mean_word_length': 3.8767123287671232, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6556250', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1159, 'n_words': 222}