newSecretCommand returns a cobra command for `secret` subcommands.
(dockerCLI command.Cli)
| 15 | |
| 16 | // newSecretCommand returns a cobra command for `secret` subcommands. |
| 17 | func newSecretCommand(dockerCLI command.Cli) *cobra.Command { |
| 18 | cmd := &cobra.Command{ |
| 19 | Use: "secret", |
| 20 | Short: "Manage Swarm secrets", |
| 21 | Args: cli.NoArgs, |
| 22 | RunE: command.ShowHelp(dockerCLI.Err()), |
| 23 | Annotations: map[string]string{ |
| 24 | "version": "1.25", |
| 25 | "swarm": "manager", |
| 26 | }, |
| 27 | DisableFlagsInUseLine: true, |
| 28 | } |
| 29 | cmd.AddCommand( |
| 30 | newSecretListCommand(dockerCLI), |
| 31 | newSecretCreateCommand(dockerCLI), |
| 32 | newSecretInspectCommand(dockerCLI), |
| 33 | newSecretRemoveCommand(dockerCLI), |
| 34 | ) |
| 35 | return cmd |
| 36 | } |
| 37 | |
| 38 | // completeNames offers completion for swarm secrets |
| 39 | func completeNames(dockerCLI completion.APIClientProvider) cobra.CompletionFunc { |
nothing calls this directly
no test coverage detected
searching dependent graphs…