feat: squash multiple modules to one

This commit is contained in:
2024-05-08 19:09:33 +03:00
parent 55719b4399
commit fef404f1a7
37 changed files with 37 additions and 491 deletions

33
cmd/sort-cli/main.go Normal file
View File

@ -0,0 +1,33 @@
package main
import (
"os"
sortcli "git.grachevko.ru/grachevko/h/sort-cli"
)
func main() {
result := run()
if _, err := os.Stdout.WriteString(result); err != nil {
panic(err)
}
os.Exit(0)
}
func run() string {
cfg := &Config{}
cfg.ParseFlags()
lines := sortcli.Content{}
lines.Load(sortcli.Open(cfg.Sources))
if cfg.Unique {
lines.Uniques()
}
lines.Sort(cfg.Reverse)
return lines.String()
}