-
Notifications
You must be signed in to change notification settings - Fork 37
/
main.go
27 lines (22 loc) · 646 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main
import (
"fmt"
"github.com/crytic/medusa/cmd"
"github.com/crytic/medusa/cmd/exitcodes"
"os"
)
func main() {
// Run our root CLI command, which contains all underlying command logic and will handle parsing/invocation.
err := cmd.Execute()
// Obtain the actual error and exit code from the error, if any.
var exitCode int
err, exitCode = exitcodes.GetInnerErrorAndExitCode(err)
// If we have an error, print it.
if err != nil && exitCode != exitcodes.ExitCodeHandledError {
fmt.Println(err)
}
// If we have a non-success exit code, exit with it.
if exitCode != exitcodes.ExitCodeSuccess {
os.Exit(exitCode)
}
}