<commit_before>package command

import (
	"strings"

	"github.com/mohae/cli"
	"github.com/mohae/contour"
	"github.com/mohae/peu/app"
)

// DCommand is a Command implementation for decompression
type DCommand struct {
	UI cli.Ui
}

// Help prints the help text for the run sub-command.
func (d *DCommand) Help() string {
	helpText := `
Usage: peu d [flags] <filelist string...>

d will take a 1 or more files and decompress them. If the -o flag is not
passed, the files will be decompressed in place. The algorithm that is 
used for decompression is determined by matching magic numbers. If a match
is not found, the algorithm is not supported and an error will be returned.

    $ peu d example.txt

    $ peu d -o=out/path example.txt
    

peu supports 1 flag:

    -o=output/path    save the output of the command to the path specified.
`
	return strings.TrimSpace(helpText)
}

// Run runs the d command; the args are a variadic list of filenames to process.
func (c *DCommand) Run(args []string) int {
	// set up the command flags
	contour.SetUsage(func() { c.UI.Output(c.Help()) })
	// Filter the flags from the args and update the config with them.
	// The args remaining after being filtered are returned.
	filteredArgs, err := contour.FilterArgs(args)
	if err != nil {
		c.UI.Error(err.Error())
		return 1
	}
	// Run the command in the package.
	message, err := app.D(filteredArgs)
	if err != nil {
		c.UI.Error(err.Error())
		return 1
	}
	c.UI.Output(message)
	return 0
}

// Synopsis provides a precis of the hello command.
func (c *CCommand) Synopsis() string {
	ret := `Compresses files using the specified algorithm
`
	return ret
}<commit_msg>CCommand -> DCommand in d.go<commit_after>package command

import (
	"strings"

	"github.com/mohae/cli"
	"github.com/mohae/contour"
	"github.com/mohae/peu/app"
)

// DCommand is a Command implementation for decompression
type DCommand struct {
	UI cli.Ui
}

// Help prints the help text for the run sub-command.
func (d *DCommand) Help() string {
	helpText := `
Usage: peu d [flags] <filelist string...>

d will take a 1 or more files and decompress them. If the -o flag is not
passed, the files will be decompressed in place. The algorithm that is 
used for decompression is determined by matching magic numbers. If a match
is not found, the algorithm is not supported and an error will be returned.

    $ peu d example.txt

    $ peu d -o=out/path example.txt
    

peu supports 1 flag:

    -o=output/path    save the output of the command to the path specified.
`
	return strings.TrimSpace(helpText)
}

// Run runs the d command; the args are a variadic list of filenames to process.
func (c *DCommand) Run(args []string) int {
	// set up the command flags
	contour.SetUsage(func() { c.UI.Output(c.Help()) })
	// Filter the flags from the args and update the config with them.
	// The args remaining after being filtered are returned.
	filteredArgs, err := contour.FilterArgs(args)
	if err != nil {
		c.UI.Error(err.Error())
		return 1
	}
	// Run the command in the package.
	message, err := app.D(filteredArgs)
	if err != nil {
		c.UI.Error(err.Error())
		return 1
	}
	c.UI.Output(message)
	return 0
}

// Synopsis provides a precis of the hello command.
func (c *DCommand) Synopsis() string {
	ret := `Compresses files using the specified algorithm
`
	return ret
}
{'fraction_non_alphanumeric': 0.09888788698527201, 'fraction_numerical': 0.003005710850616171, 'mean_word_length': 3.3847167325428194, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6145931', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1057, 'n_words': 435}