mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
add debug flag for zli commands (#785)
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com> Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com>
This commit is contained in:
committed by
GitHub
parent
0f7b174fc0
commit
1bad90bb9d
+5
-1
@@ -23,7 +23,7 @@ func NewCveCommand(searchService SearchService) *cobra.Command {
|
||||
|
||||
var servURL, user, outputFormat string
|
||||
|
||||
var isSpinner, verifyTLS, fixedFlag, verbose bool
|
||||
var isSpinner, verifyTLS, fixedFlag, verbose, debug bool
|
||||
|
||||
cveCmd := &cobra.Command{
|
||||
Use: "cve [config-name]",
|
||||
@@ -87,6 +87,7 @@ func NewCveCommand(searchService SearchService) *cobra.Command {
|
||||
fixedFlag: &fixedFlag,
|
||||
verifyTLS: &verifyTLS,
|
||||
verbose: &verbose,
|
||||
debug: &debug,
|
||||
resultWriter: cmd.OutOrStdout(),
|
||||
spinner: spinnerState{spin, isSpinner},
|
||||
}
|
||||
@@ -109,6 +110,7 @@ func NewCveCommand(searchService SearchService) *cobra.Command {
|
||||
user: &user,
|
||||
outputFormat: &outputFormat,
|
||||
fixedFlag: &fixedFlag,
|
||||
debug: &debug,
|
||||
}
|
||||
|
||||
setupCveFlags(cveCmd, vars)
|
||||
@@ -127,6 +129,7 @@ func setupCveFlags(cveCmd *cobra.Command, variables cveFlagVariables) {
|
||||
" JSON and YAML format return all info for CVEs")
|
||||
|
||||
cveCmd.Flags().BoolVar(variables.fixedFlag, "fixed", false, "List tags which have fixed a CVE")
|
||||
cveCmd.Flags().BoolVar(variables.debug, "debug", false, "Show debug output")
|
||||
}
|
||||
|
||||
type cveFlagVariables struct {
|
||||
@@ -135,6 +138,7 @@ type cveFlagVariables struct {
|
||||
user *string
|
||||
outputFormat *string
|
||||
fixedFlag *bool
|
||||
debug *bool
|
||||
}
|
||||
|
||||
type field struct {
|
||||
|
||||
Reference in New Issue
Block a user