mirror of
https://github.com/jimeh/rbheap.git
synced 2026-02-19 12:56:46 +00:00
Switch from kingpin to cobra
This enables easier use of sub-commands for flexibility
This commit is contained in:
19
cmd/helpers.go
Normal file
19
cmd/helpers.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func usage_er(cmd *cobra.Command, msg interface{}) {
|
||||
cmd.Usage()
|
||||
fmt.Println("")
|
||||
er(msg)
|
||||
}
|
||||
|
||||
func er(msg interface{}) {
|
||||
fmt.Println("ERROR:", msg)
|
||||
os.Exit(1)
|
||||
}
|
||||
Reference in New Issue
Block a user