<commit_before>// escargs reads lines from the standard input and prints shell-escaped
// versions. Unlinke xargs, blank lines on the standard input are not
// discarded.
package main

import (
	"bufio"
	"fmt"
	"os"

	"github.com/alessio/shellescape"
)

func main() {
	firstScan := true
	scanner := bufio.NewScanner(os.Stdin)

	for scanner.Scan() {
		if firstScan {
			firstScan = false
		} else {
			fmt.Printf(" ")
		}

		fmt.Printf("%s", shellescape.Quote(scanner.Text()))
	}
}<commit_msg>escargs: add -D flag<commit_after>// escargs reads lines from the standard input and prints shell-escaped
// versions. Unlinke xargs, blank lines on the standard input are not
// discarded.
package main

import (
	"bufio"
	"flag"
	"fmt"
	"os"

	"github.com/alessio/shellescape"
)

var (
	flagDiscardBlankLines = flag.Bool("D", false, "ignore blank lines on the standard input.")
)

func main() {
	flag.Parse()

	firstScan := true
	scanner := bufio.NewScanner(os.Stdin)

	for scanner.Scan() {
		line := scanner.Text()
		if *flagDiscardBlankLines && len(line) == 0 {
			continue
		}

		if firstScan {
			firstScan = false
		} else {
			fmt.Printf(" ")
		}

		fmt.Printf("%s", shellescape.Quote(line))
	}
}
{'fraction_non_alphanumeric': 0.13640167364016736, 'fraction_numerical': 0.0008368200836820083, 'mean_word_length': 3.513207547169811, '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': '4000294', 'n_tokens_mistral': 460, 'n_tokens_neox': 423, 'n_words': 115}