From dad2cdd81a3ee4e737c1ae7a0f129085d2f4ee28 Mon Sep 17 00:00:00 2001 From: Herve ESTEGUET Date: Tue, 14 May 2024 10:58:44 +0200 Subject: [PATCH] WKS-928 - Expose commands --- cli/cli.go | 28 ++++++++++++++++++++++++++++ main.go | 28 ++-------------------------- 2 files changed, 30 insertions(+), 26 deletions(-) create mode 100644 cli/cli.go diff --git a/cli/cli.go b/cli/cli.go new file mode 100644 index 0000000..322723c --- /dev/null +++ b/cli/cli.go @@ -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(), + } +} diff --git a/main.go b/main.go index 4b71128..688ec68 100644 --- a/main.go +++ b/main.go @@ -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()) }