Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Use subcommands for example/cli #188

Closed
stevvooe opened this issue Oct 3, 2016 · 5 comments
Closed

Use subcommands for example/cli #188

stevvooe opened this issue Oct 3, 2016 · 5 comments

Comments

@stevvooe
Copy link

stevvooe commented Oct 3, 2016

It is very odd to have infrakit/foo everywhere. No need to have all the different packages. Just use cobra subcommands.

@wfarner
Copy link
Contributor

wfarner commented Oct 11, 2016

It does appear overly-complicated at first glance, but the separate commands are an artifact of the plugin-oriented nature of InfraKit. Since plugins are daemons that communicate via sockets, they are built and executed independently. Without language-level support for dynamic library loading, i'm not sure there's a better way. Any ideas?

@stevvooe
Copy link
Author

@wfarner You could use git-style sub-command resolution.

@wfarner
Copy link
Contributor

wfarner commented Oct 12, 2016

@stevvooe not a good fit here, since plugins will be coming from different build sources, and can't be expected to be placed in the same directory.

@stevvooe
Copy link
Author

@wfarner Git doesn't require this. It just does a search through a path variable. They don't need to be in the same directory. exec.LookPath actually searches all paths. So, if you're using two projects, you just do PATH=$PROJ_ONE_PATH:$PROJ_TWO_PATH.

@wfarner
Copy link
Contributor

wfarner commented Oct 12, 2016

Capturing offline discussion with @stevvooe, a CLI-oriented flow won't work well across plugin boundaries as it would require CLI-specific APIs for plugin communication (e.g. surfacing help text, arguments, output, etc). The long-term goal is to delegate plugin management to the environment InfraKit is used in. For example, in Docker Engine we will provide scaffolding to run them as Docker plugins.

@wfarner wfarner closed this as completed Oct 12, 2016
chungers pushed a commit to chungers/infrakit that referenced this issue Sep 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants