mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 00:22:08 -06:00
Add cli banner
This commit is contained in:
parent
ce6c1b3395
commit
a8bcb7a898
10
README.md
10
README.md
@ -1,5 +1,5 @@
|
||||
# vet : The dependency vetting tool
|
||||
Tool for identifying software supply chain risks
|
||||
# vet
|
||||
Tool for identifying open source software supply chain risks
|
||||
|
||||
## TL;DR
|
||||
|
||||
@ -40,3 +40,9 @@ Insights API Key can be passed at runtime using environment variable
|
||||
```bash
|
||||
VET_INSIGHTS_API_KEY=... vet scan
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### How do I disable the stupid banner?
|
||||
|
||||
Set environment variable `VET_DISABLE_BANNER=1`
|
||||
|
||||
25
main.go
25
main.go
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/safedep/vet/pkg/common/logger"
|
||||
"github.com/spf13/cobra"
|
||||
@ -13,10 +14,24 @@ var (
|
||||
debug bool
|
||||
)
|
||||
|
||||
var banner string = `
|
||||
.----------------. .----------------. .----------------.
|
||||
| .--------------. || .--------------. || .--------------. |
|
||||
| | ____ ____ | || | _________ | || | _________ | |
|
||||
| ||_ _| |_ _| | || | |_ ___ | | || | | _ _ | | |
|
||||
| | \ \ / / | || | | |_ \_| | || | |_/ | | \_| | |
|
||||
| | \ \ / / | || | | _| _ | || | | | | |
|
||||
| | \ ' / | || | _| |___/ | | || | _| |_ | |
|
||||
| | \_/ | || | |_________| | || | |_____| | |
|
||||
| | | || | | || | | |
|
||||
| '--------------' || '--------------' || '--------------' |
|
||||
'----------------' '----------------' '----------------'
|
||||
`
|
||||
|
||||
func main() {
|
||||
cmd := &cobra.Command{
|
||||
Use: "vet [OPTIONS] COMMAND [ARG...]",
|
||||
Short: "Vet your 3rd party dependencies for security risks",
|
||||
Short: "[ Establish trust in open source software supply chain ]",
|
||||
TraverseChildren: true,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if len(args) == 0 {
|
||||
@ -35,6 +50,7 @@ func main() {
|
||||
cmd.AddCommand(newVersionCommand())
|
||||
|
||||
cobra.OnInitialize(func() {
|
||||
printBanner()
|
||||
logger.SetLogLevel(verbose, debug)
|
||||
})
|
||||
|
||||
@ -42,3 +58,10 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func printBanner() {
|
||||
bRet, err := strconv.ParseBool(os.Getenv("VET_DISABLE_BANNER"))
|
||||
if (err != nil) || (!bRet) {
|
||||
fmt.Print(banner)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user