code: func newInspectCommand(dockerCli command.Cli) *cobra.Command {
  	var opts inspectOptions
  
  	cmd := &cobra.Command{
  		Use:   "inspect [OPTIONS] [CONTEXT] [CONTEXT...]",
  		Short: "Display detailed information on one or more contexts",
  		RunE: func(cmd *cobra.Command, args []string) error {
  			opts.refs = args
  			if len(opts.refs) == 0 {
  				if dockerCli.CurrentContext() == "" {
  					return errors.New("no context specified")
  				}
  				opts.refs = []string{dockerCli.CurrentContext()}
  			}
  			return runInspect(dockerCli, opts)
  		},
  	}
  
  	flags := cmd.Flags()
  	flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given Go template")
  	return cmd
  }
docs: // newInspectCommand creates a new cobra.Command for `docker image inspect`