code: func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error) {
  	store := &ContextStoreWithDefault{
  		Store: store.New(cliconfig.ContextStoreDir(), defaultContextStoreConfig()),
  		Resolver: func() (*DefaultContext, error) {
  			return resolveDefaultContext(opts, configFile, ioutil.Discard)
  		},
  	}
  	contextName, err := resolveContextName(opts, configFile, store)
  	if err != nil {
  		return nil, err
  	}
  	endpoint, err := resolveDockerEndpoint(store, contextName)
  	if err != nil {
  		return nil, errors.Wrap(err, "unable to resolve docker endpoint")
  	}
  	return newAPIClientFromEndpoint(endpoint, configFile)
  }
docs: // NewAPIClientFromFlags creates a new APIClient from command line flags