main.go 639 B

12345678910111213141516171819202122232425262728293031
  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "github.com/pierrec/lz4/internal/cmdflag"
  6. "github.com/pierrec/lz4/internal/cmds"
  7. )
  8. func init() {
  9. const onError = flag.ExitOnError
  10. cmdflag.New(
  11. "compress", "[arguments] [<file name> ...]",
  12. "Compress the given files or from stdin to stdout.",
  13. onError, cmds.Compress)
  14. cmdflag.New(
  15. "uncompress", "[arguments] [<file name> ...]",
  16. "Uncompress the given files or from stdin to stdout.",
  17. onError, cmds.Uncompress)
  18. }
  19. func main() {
  20. flag.CommandLine.Bool(cmdflag.VersionBoolFlag, false, "print the program version")
  21. err := cmdflag.Parse()
  22. if err != nil {
  23. fmt.Println(err)
  24. return
  25. }
  26. }