mirror of https://github.com/docker/cli.git
Merge pull request #3437 from ndeloof/cli-plugin-standalone
introduce plugin.RunningStandalone utility func
This commit is contained in:
commit
531810bb1b
|
@ -160,3 +160,11 @@ func newMetadataSubcommand(plugin *cobra.Command, meta manager.Metadata) *cobra.
|
|||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
// RunningStandalone tells a CLI plugin it is run standalone by direct execution
|
||||
func RunningStandalone() bool {
|
||||
if os.Getenv(manager.ReexecEnvvar) != "" {
|
||||
return false
|
||||
}
|
||||
return len(os.Args) < 2 || os.Args[1] != manager.MetadataSubcommandName
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue