#8 add init msg

This commit is contained in:
Gorbunov Kirill Andreevich 2024-03-31 15:48:15 +03:00
parent edfe5731f2
commit 84b8f82ea1

View File

@ -40,6 +40,24 @@ import (
// https://docs.github.com/ru/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file // 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 ( var (
DefaultPullRequestTitle = `Bump {{.Name}} from {{.VersionOld}} to {{.VersionNew}}` DefaultPullRequestTitle = `Bump {{.Name}} from {{.VersionOld}} to {{.VersionNew}}`
DefaultPullRequestBody = `Bumps {{.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)) logger.Fatal(ctx, fmt.Sprintf("load cli cfg failed: %v", err))
} }
if cliCfg.Path == "" && cliCfg.Method == "" {
logger.Info(ctx, initMsg)
return
}
path := "." path := "."
if len(os.Args) > 1 { if len(os.Args) > 1 {
path = os.Args[1] path = os.Args[1]