bb/m/tool/sort/sort.go
2022-06-17 13:28:39 +05:00

21 lines
309 B
Go

package sort
import (
"fmt"
"os"
"sort"
"flag"
"github.com/k1574/goblin/m/input"
)
func Run(args []string) {
flagSet := flag.NewFlagSet(args[0], flag.ExitOnError)
flagSet.Parse(args[1:])
lines, _ := input.ReadAllLines(os.Stdin)
sort.Strings(lines)
for _, l := range lines {
fmt.Print(l)
}
}