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

26
cmd/sort-cli/config.go Normal file
View File

@ -0,0 +1,26 @@
package main
import "flag"
type Config struct {
Key int
Numeric bool
Reverse bool
Unique bool
Sources []string
}
func (c *Config) ParseFlags() {
flag.IntVar(&c.Key, "k", 0, "sort via column")
flag.BoolVar(&c.Numeric, "n", false, "compare according to string numerical value")
flag.BoolVar(&c.Reverse, "r", false, "reverse the result of comparisons")
flag.BoolVar(&c.Unique, "u", false, "output only the first of an equal run")
flag.Parse()
c.Sources = flag.Args()
if len(c.Sources) == 0 {
c.Sources = []string{"-"}
}
}