Skip to content

Commit

Permalink
Merge pull request #3 from ehl-jf/feature/WKS-928-expose-commands
Browse files Browse the repository at this point in the history
WKS-928 - Expose commands
  • Loading branch information
RemiBou authored May 14, 2024
2 parents 7d48dfd + dad2cdd commit db029d8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
28 changes: 28 additions & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package cli

import (
"github.com/jfrog/jfrog-cli-core/v2/plugins/components"
"github.com/jfrog/workers-cli/commands"
)

func GetApp() components.App {
app := components.App{}
app.Name = "worker"
app.Description = "Tools for managing workers"
app.Version = "v1.0.0"
app.Commands = getCommands()
return app
}

func getCommands() []components.Command {
return []components.Command{
commands.GetInitCommand(),
commands.GetDryRunCommand(),
commands.GetDeployCommand(),
commands.GetExecuteCommand(),
commands.GetRemoveCommand(),
commands.GetListCommand(),
commands.GetAddSecretCommand(),
commands.GetListEventsCommand(),
}
}
28 changes: 2 additions & 26 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,9 @@ package main

import (
"github.com/jfrog/jfrog-cli-core/v2/plugins"
"github.com/jfrog/jfrog-cli-core/v2/plugins/components"

"github.com/jfrog/workers-cli/commands"
"github.com/jfrog/workers-cli/cli"
)

func main() {
plugins.PluginMain(getApp())
}

func getApp() components.App {
app := components.App{}
app.Name = "worker"
app.Description = "Tools for managing workers"
app.Version = "v1.0.0"
app.Commands = getCommands()
return app
}

func getCommands() []components.Command {
return []components.Command{
commands.GetInitCommand(),
commands.GetDryRunCommand(),
commands.GetDeployCommand(),
commands.GetExecuteCommand(),
commands.GetRemoveCommand(),
commands.GetListCommand(),
commands.GetAddSecretCommand(),
commands.GetListEventsCommand(),
}
plugins.PluginMain(cli.GetApp())
}

0 comments on commit db029d8

Please sign in to comment.