github.com/grailbio/bigslice@v0.0.0-20230519005545-30c4c12152ad/cmd/bigslice/run.go (about) 1 // Copyright 2019 GRAIL, Inc. All rights reserved. 2 // Use of this source code is governed by the Apache 2.0 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import ( 8 "context" 9 "fmt" 10 "os" 11 12 "github.com/grailbio/bigslice/cmd/bigslice/bigslicecmd" 13 ) 14 15 func runCmdUsage() { 16 fmt.Fprintf(os.Stderr, bigslicecmd.RunUsage) 17 os.Exit(2) 18 } 19 20 func runCmd(args []string) { 21 if len(args) == 0 { 22 runCmdUsage() 23 } 24 if args[0] == "-help" || args[0] == "--help" { 25 runCmdUsage() 26 } 27 bigslicecmd.Run(context.Background(), args) 28 }