(dockerCLI command.Cli)
| 27 | } |
| 28 | |
| 29 | func newSignerAddCommand(dockerCLI command.Cli) *cobra.Command { |
| 30 | var options signerAddOptions |
| 31 | cmd := &cobra.Command{ |
| 32 | Use: "add OPTIONS NAME REPOSITORY [REPOSITORY...] ", |
| 33 | Short: "Add a signer", |
| 34 | Args: cli.RequiresMinArgs(2), |
| 35 | RunE: func(cmd *cobra.Command, args []string) error { |
| 36 | options.signer = args[0] |
| 37 | options.repos = args[1:] |
| 38 | return addSigner(cmd.Context(), dockerCLI, options) |
| 39 | }, |
| 40 | DisableFlagsInUseLine: true, |
| 41 | } |
| 42 | flags := cmd.Flags() |
| 43 | options.keys = opts.NewListOpts(nil) |
| 44 | flags.Var(&options.keys, "key", "Path to the signer's public key file") |
| 45 | return cmd |
| 46 | } |
| 47 | |
| 48 | var validSignerName = lazyregexp.New(`^[a-z0-9][a-z0-9\_\-]*$`).MatchString |
| 49 |
searching dependent graphs…