<commit_before>package main

import (
	"flag"
	"fmt"
	"log"
	"os"
	"path/filepath"
	"strings"

	dnotifier "github.com/satoshun/dnotifier/lib"
)

var (
	command string

	// slack params
	slackHookURL = flag.String("u", "", "your slack hook url")
	channel      = flag.String("c", "#general", "your channel name. default #general")
	userName     = flag.String("n", "", "your username")
	iconEmoji    = flag.String("i", ":ghost:", "your icon emoji")
	files        arrayFlags
)

type arrayFlags []string

func (i *arrayFlags) String() string {
	return "want to watch files"
}

func (i *arrayFlags) Set(value string) error {
	*i = append(*i, value)
	return nil
}

func main() {
	command = strings.ToLower(os.Args[1])
	if command != "slack" {
		log.Fatal("only enable Slack command")
	}
	// remove subcommand
	copy(os.Args[1:], os.Args[2:])

	flag.Var(&files, "f", "specified files")
	flag.Parse()

	if len(files) == 0 {
		log.Fatal("please specify -f option")
	}

	var ms dnotifier.Messenger
	if command == "slack" {
		if *slackHookURL == "" || *channel == "" {
			log.Fatal("necessary webhook url and channel params: %s,%s", *slackHookURL, *channel)
		}
		ms = dnotifier.NewSlack(*slackHookURL, *channel, *iconEmoji, *userName)
	}
	if ms == nil {
		log.Fatal("illegal args")
	}

	for i, f := range files {
		files[i], _ = filepath.Abs(f)
		fmt.Printf("Watching: %s ...\n", f)
	}
<commit_msg>use log format<commit_after>package main

import (
	"flag"
	"fmt"
	"log"
	"os"
	"path/filepath"
	"strings"

	dnotifier "github.com/satoshun/dnotifier/lib"
)

var (
	command string

	// slack params
	slackHookURL = flag.String("u", "", "your slack hook url")
	channel      = flag.String("c", "#general", "your channel name. default #general")
	userName     = flag.String("n", "", "your username")
	iconEmoji    = flag.String("i", ":ghost:", "your icon emoji")
	files        arrayFlags
)

type arrayFlags []string

func (i *arrayFlags) String() string {
	return "want to watch files"
}

func (i *arrayFlags) Set(value string) error {
	*i = append(*i, value)
	return nil
}

func main() {
	command = strings.ToLower(os.Args[1])
	if command != "slack" {
		log.Fatal("only enable Slack command")
	}
	// remove subcommand
	copy(os.Args[1:], os.Args[2:])

	flag.Var(&files, "f", "specified files")
	flag.Parse()

	if len(files) == 0 {
		log.Fatal("please specify -f option")
	}

	var ms dnotifier.Messenger
	if command == "slack" {
		if *slackHookURL == "" || *channel == "" {
			log.Fatalf("necessary webhook url and channel params: %s,%s", *slackHookURL, *channel)
		}
		ms = dnotifier.NewSlack(*slackHookURL, *channel, *iconEmoji, *userName)
	}
	if ms == nil {
		log.Fatal("illegal args")
	}

	for i, f := range files {
		files[i], _ = filepath.Abs(f)
		fmt.Printf("Watching: %s ...\n", f)
	}

{'fraction_non_alphanumeric': 0.17447728911319393, 'fraction_numerical': 0.002883922134102379, 'mean_word_length': 3.7274275979557068, 'pattern_counts': {'":': 2, '<': 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': '267272', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1047, 'n_words': 266}