@@ -29,7 +29,13 @@ func NewCommand(out output.Output) *cobra.Command {
2929
3030// InstallCommand creates a new command to install
3131func InstallCommand (out output.Output ) * cobra.Command {
32- return & cobra.Command {
32+ var (
33+ pluginName string
34+ pluginVersion string
35+ pluginURL string
36+ )
37+
38+ cmd := & cobra.Command {
3339 Use : "install" ,
3440 Short : "Installs a tool for a specific plugin" ,
3541 RunE : func (cmd * cobra.Command , args []string ) error {
@@ -42,19 +48,29 @@ func InstallCommand(out output.Output) *cobra.Command {
4248
4349 err = defaultSource .InstallPluginVersion (
4450 & types.InstallPluginVersionRequest {
45- Name : "golang" ,
46- Version : "1.19.3" ,
51+ Name : pluginName ,
52+ Version : pluginVersion ,
53+ URL : pluginURL ,
4754 },
4855 )
56+
4957 if err != nil {
5058 return fmt .Errorf ("failed to install plugin: %w" , err )
5159 }
5260
53- fmt .Printf ("installed plugin %s with version %s\n " , "golang" , "1.19.3" )
61+ fmt .Printf ("installed plugin %s with version %s\n " , pluginName , pluginVersion )
5462
5563 return nil
5664 },
5765 }
66+
67+ cmd .Flags ().StringVar (& pluginName , "name" , "" , "name of the plugin" )
68+ cmd .Flags ().StringVar (& pluginVersion , "version" , "" , "version of the plugin" )
69+ cmd .Flags ().StringVar (& pluginURL , "url" , "" , "url of the plugin" )
70+ cmd .MarkFlagRequired ("name" )
71+ cmd .MarkFlagRequired ("version" )
72+
73+ return cmd
5874}
5975
6076// ListCommand creates a new command to remove a plugin
0 commit comments