mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 00:22:08 -06:00
29 lines
610 B
Go
29 lines
610 B
Go
package code
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/safedep/vet/internal/command"
|
|
)
|
|
|
|
var languageCodes []string
|
|
|
|
func NewCodeCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "code",
|
|
Short: "Analyze source code",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return cmd.Help()
|
|
},
|
|
}
|
|
|
|
defaultAllLanguageCodes, err := getAllLanguageCodeStrings()
|
|
command.FailOnError("setup-default-languages", err)
|
|
|
|
cmd.PersistentFlags().StringArrayVar(&languageCodes, "lang", defaultAllLanguageCodes, "Source code languages to analyze")
|
|
|
|
cmd.AddCommand(newScanCommand())
|
|
|
|
return cmd
|
|
}
|