github.com/Schaudge/grailbase@v0.0.0-20240223061707-44c758a471c0/cmd/grail-file/main.go (about) 1 package main 2 3 import ( 4 "context" 5 "flag" 6 "os" 7 8 "github.com/Schaudge/grailbase/cmd/grail-file/cmd" 9 "github.com/Schaudge/grailbase/file" 10 "github.com/Schaudge/grailbase/file/s3file" 11 "github.com/Schaudge/grailbase/log" 12 ) 13 14 func main() { 15 help := flag.Bool("help", false, "Display help about this command") 16 flag.Parse() 17 if *help { 18 cmd.PrintHelp() 19 os.Exit(0) 20 } 21 22 log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds | log.Lshortfile) 23 file.RegisterImplementation("s3", func() file.Implementation { 24 return s3file.NewImplementation(s3file.NewDefaultProvider(), s3file.Options{}) 25 }) 26 err := cmd.Run(context.Background(), os.Args[1:]) 27 if err != nil { 28 log.Fatal(err) 29 } 30 }