bb/sort/sort.go
2020-03-23 21:12:50 +05:00

23 lines
341 B
Go

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