mirror of
https://github.com/safedep/vet.git
synced 2025-12-11 17:44:20 -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
|
# vet
|
||||||
Tool for identifying software supply chain risks
|
Tool for identifying open source software supply chain risks
|
||||||
|
|
||||||
## TL;DR
|
## TL;DR
|
||||||
|
|
||||||
@ -40,3 +40,9 @@ Insights API Key can be passed at runtime using environment variable
|
|||||||
```bash
|
```bash
|
||||||
VET_INSIGHTS_API_KEY=... vet scan
|
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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/safedep/vet/pkg/common/logger"
|
"github.com/safedep/vet/pkg/common/logger"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -13,10 +14,24 @@ var (
|
|||||||
debug bool
|
debug bool
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var banner string = `
|
||||||
|
.----------------. .----------------. .----------------.
|
||||||
|
| .--------------. || .--------------. || .--------------. |
|
||||||
|
| | ____ ____ | || | _________ | || | _________ | |
|
||||||
|
| ||_ _| |_ _| | || | |_ ___ | | || | | _ _ | | |
|
||||||
|
| | \ \ / / | || | | |_ \_| | || | |_/ | | \_| | |
|
||||||
|
| | \ \ / / | || | | _| _ | || | | | | |
|
||||||
|
| | \ ' / | || | _| |___/ | | || | _| |_ | |
|
||||||
|
| | \_/ | || | |_________| | || | |_____| | |
|
||||||
|
| | | || | | || | | |
|
||||||
|
| '--------------' || '--------------' || '--------------' |
|
||||||
|
'----------------' '----------------' '----------------'
|
||||||
|
`
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "vet [OPTIONS] COMMAND [ARG...]",
|
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,
|
TraverseChildren: true,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
@ -35,6 +50,7 @@ func main() {
|
|||||||
cmd.AddCommand(newVersionCommand())
|
cmd.AddCommand(newVersionCommand())
|
||||||
|
|
||||||
cobra.OnInitialize(func() {
|
cobra.OnInitialize(func() {
|
||||||
|
printBanner()
|
||||||
logger.SetLogLevel(verbose, debug)
|
logger.SetLogLevel(verbose, debug)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -42,3 +58,10 @@ func main() {
|
|||||||
os.Exit(1)
|
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