(out io.Writer)
| 37 | ` |
| 38 | |
| 39 | func newVerifyCmd(out io.Writer) *cobra.Command { |
| 40 | client := action.NewVerify() |
| 41 | |
| 42 | cmd := &cobra.Command{ |
| 43 | Use: "verify PATH", |
| 44 | Short: "verify that a chart at the given path has been signed and is valid", |
| 45 | Long: verifyDesc, |
| 46 | Args: require.ExactArgs(1), |
| 47 | ValidArgsFunction: func(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) { |
| 48 | if len(args) == 0 { |
| 49 | // Allow file completion when completing the argument for the path |
| 50 | return nil, cobra.ShellCompDirectiveDefault |
| 51 | } |
| 52 | // No more completions, so disable file completion |
| 53 | return noMoreArgsComp() |
| 54 | }, |
| 55 | RunE: func(_ *cobra.Command, args []string) error { |
| 56 | result, err := client.Run(args[0]) |
| 57 | if err != nil { |
| 58 | return err |
| 59 | } |
| 60 | |
| 61 | fmt.Fprint(out, result) |
| 62 | |
| 63 | return nil |
| 64 | }, |
| 65 | } |
| 66 | |
| 67 | cmd.Flags().StringVar(&client.Keyring, "keyring", defaultKeyring(), "keyring containing public keys") |
| 68 | |
| 69 | return cmd |
| 70 | } |
no test coverage detected
searching dependent graphs…