mirror of https://github.com/docker/cli.git
plugin: make runplugin public
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
92dc906059
commit
d2632cea78
|
@ -24,7 +24,8 @@ import (
|
||||||
// called.
|
// called.
|
||||||
var PersistentPreRunE func(*cobra.Command, []string) error
|
var PersistentPreRunE func(*cobra.Command, []string) error
|
||||||
|
|
||||||
func runPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager.Metadata) error {
|
// RunPlugin executes the specified plugin command
|
||||||
|
func RunPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager.Metadata) error {
|
||||||
tcmd := newPluginCommand(dockerCli, plugin, meta)
|
tcmd := newPluginCommand(dockerCli, plugin, meta)
|
||||||
|
|
||||||
var persistentPreRunOnce sync.Once
|
var persistentPreRunOnce sync.Once
|
||||||
|
@ -60,7 +61,7 @@ func Run(makeCmd func(command.Cli) *cobra.Command, meta manager.Metadata) {
|
||||||
|
|
||||||
plugin := makeCmd(dockerCli)
|
plugin := makeCmd(dockerCli)
|
||||||
|
|
||||||
if err := runPlugin(dockerCli, plugin, meta); err != nil {
|
if err := RunPlugin(dockerCli, plugin, meta); err != nil {
|
||||||
if sterr, ok := err.(cli.StatusError); ok {
|
if sterr, ok := err.(cli.StatusError); ok {
|
||||||
if sterr.Status != "" {
|
if sterr.Status != "" {
|
||||||
fmt.Fprintln(dockerCli.Err(), sterr.Status)
|
fmt.Fprintln(dockerCli.Err(), sterr.Status)
|
||||||
|
|
Loading…
Reference in New Issue