<commit_before>// 24 september 2014

package main

import (
	"fmt"
	"os"
	"os/exec"
	"flag"
	"bytes"
	"strings"
)

var showall = flag.Bool("x", false, "show all commands as they run")

type Executor struct {
	Name	string
	Line		[]string
	Output	*bytes.Buffer
	Error		error
}

func (e *Executor) Do() {
	if *showall {
		fmt.Printf("%s\n", strings.Join(e.Line, " "))
	}
	cmd := exec.Command(e.Line[0], e.Line[1:]...)
	cmd.Env = os.Environ()
	e.Output = new(bytes.Buffer)
	cmd.Stdout = e.Output
	cmd.Stderr = e.Output
	e.Error = cmd.Run()
	builder <- e
}

/*
func main() {
	go (&Executor{
		Name:	"echo",
		Line:		[]string{"echo", "hello,", "world"},
	}).Do()
	go (&Executor{
		Name:	"sleep",
		Line:		[]string{"sleep", "5"},
	}).Do()
	go (&Executor{
		Name:	"badcommand",
		Line:		[]string{"badcommand"},
	}).Do()
	go (&Executor{
		Name:	"stderr",
		Line:		[]string{"gcc", "--qwertyuiop"},
	}).Do()
	for i := 0; i < 4; i++ {
		e := <-builder
		fmt.Printf("done %q %v\n", e.Name, e.Error)
		fmt.Printf("%q %q\n", e.Stdout.String(), e.Stderr.String())
	}
}
*/<commit_msg>Removed ancient commented-out Executor test.<commit_after>// 24 september 2014

package main

import (
	"fmt"
	"os"
	"os/exec"
	"flag"
	"bytes"
	"strings"
)

var showall = flag.Bool("x", false, "show all commands as they run")

type Executor struct {
	Name	string
	Line		[]string
	Output	*bytes.Buffer
	Error		error
}

func (e *Executor) Do() {
	if *showall {
		fmt.Printf("%s\n", strings.Join(e.Line, " "))
	}
	cmd := exec.Command(e.Line[0], e.Line[1:]...)
	cmd.Env = os.Environ()
	e.Output = new(bytes.Buffer)
	cmd.Stdout = e.Output
	cmd.Stderr = e.Output
	e.Error = cmd.Run()
	builder <- e
}
{'fraction_non_alphanumeric': 0.2095123419626731, 'fraction_numerical': 0.011438892233594221, 'mean_word_length': 3.3852242744063323, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2035869', 'n_tokens_mistral': 732, 'n_tokens_neox': 704, 'n_words': 169}