newShowCommand creates a new cobra.Command for `docker context sow`
(dockerCLI command.Cli)
| 10 | |
| 11 | // newShowCommand creates a new cobra.Command for `docker context sow` |
| 12 | func newShowCommand(dockerCLI command.Cli) *cobra.Command { |
| 13 | cmd := &cobra.Command{ |
| 14 | Use: "show", |
| 15 | Short: "Print the name of the current context", |
| 16 | Args: cli.NoArgs, |
| 17 | RunE: func(cmd *cobra.Command, args []string) error { |
| 18 | runShow(dockerCLI) |
| 19 | return nil |
| 20 | }, |
| 21 | ValidArgsFunction: cobra.NoFileCompletions, |
| 22 | DisableFlagsInUseLine: true, |
| 23 | } |
| 24 | return cmd |
| 25 | } |
| 26 | |
| 27 | func runShow(dockerCli command.Cli) { |
| 28 | fmt.Fprintln(dockerCli.Out(), dockerCli.CurrentContext()) |
searching dependent graphs…