This commit is contained in:
Bryson Steck 2025-05-21 22:11:36 -06:00
commit 6c9dcb95e9
Signed by: bryson
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4
3 changed files with 53 additions and 0 deletions

0
.gitignore vendored Normal file
View file

50
fatten.go Normal file
View file

@ -0,0 +1,50 @@
package main
import (
"flag"
"fmt"
"io"
"os"
"strings"
)
var fat_table []string = []string{
"<",
">",
":",
"\"",
"/",
"\\",
"|",
"?",
"*",
}
func fatten(stdin bool, data string) {
for _, i := range fat_table {
data = strings.ReplaceAll(data, i, "_")
}
if stdin {
fmt.Print(data)
} else {
fmt.Println(data)
}
}
func main() {
flag.Parse()
if len(flag.Args()) > 0 {
for _, i := range flag.Args() {
fatten(false, i)
}
} else {
stdin, err := io.ReadAll(os.Stdin)
if err != nil {
panic(err)
}
fatten(true, string(stdin))
}
os.Exit(0)
}

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module brysonsteck.xyz/fatten
go 1.24.3