From 84b8f82ea190d69a8bb1d81737009797b0ab5a70 Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Sun, 31 Mar 2024 15:48:15 +0300 Subject: [PATCH] #8 add init msg --- cmd/pkgdashcli/main.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cmd/pkgdashcli/main.go b/cmd/pkgdashcli/main.go index ff34f32..20e7653 100644 --- a/cmd/pkgdashcli/main.go +++ b/cmd/pkgdashcli/main.go @@ -40,6 +40,24 @@ import ( // https://docs.github.com/ru/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +var initMsg = ` + Pkgdashcli allows you to define a version update for a dependency and start + merge requests in version control systems. + + Usage: + pkgdashcli --method {{method}} --path {{name of dep}} + + Commands: + checkupdate | CheckUpdate collects a list of dependencies with the latest updates. + list | Returns a list of PR for this repository with update dependencies. + update --path {{name of one dep or empty for update all dep}} | Creates a PR with the specified dependency update in path or creates a PR with dependency updates for all modules if path is empty. + close --path {{name of one dep or empty for close all pr}} | Closes the PR for the specified dependency or closes all PRs with dependency updates if path is empty . + + Flags: + --command | The command to execute + --path | The name of the module to create/close the PR, if empty, the command is executed for all modules. +` + var ( DefaultPullRequestTitle = `Bump {{.Name}} from {{.VersionOld}} to {{.VersionNew}}` DefaultPullRequestBody = `Bumps {{.Name}} from {{.VersionOld}} to {{.VersionNew}}` @@ -146,6 +164,11 @@ func main() { logger.Fatal(ctx, fmt.Sprintf("load cli cfg failed: %v", err)) } + if cliCfg.Path == "" && cliCfg.Method == "" { + logger.Info(ctx, initMsg) + return + } + path := "." if len(os.Args) > 1 { path = os.Args[1]