#19 #20

Closed
kgorbunov wants to merge 112 commits from kgorbunov/pkgdash:#19 into master
4 changed files with 12 additions and 15 deletions
Showing only changes of commit 7bb53c8ef1 - Show all commits

View File

@ -92,7 +92,7 @@ type Data struct {
Modules map[string]modules.Update Modules map[string]modules.Update
} }
func main() { func pkgdashcli() {
var err error var err error
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())

View File

@ -10,7 +10,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
// deleteCmd represents the delete command
var deleteCmd = NewDeleteCommand() var deleteCmd = NewDeleteCommand()
type DeleteFlags struct { type DeleteFlags struct {
@ -23,7 +22,7 @@ func init() {
} }
func NewDeleteCommand() *cobra.Command { func NewDeleteCommand() *cobra.Command {
var flags UpdateFlags var flags DeleteFlags
ctx := context.Background() ctx := context.Background()
@ -68,8 +67,8 @@ func NewDeleteCommand() *cobra.Command {
}, },
} }
deleteCmd.Flags().BoolVarP(&flags.all, "all", "a", false, "Deletes everything depending") cmd.Flags().BoolVarP(&flags.all, "all", "a", false, "Deletes everything depending")
deleteCmd.Flags().StringVarP(&flags.mod, "mod", "m", "", "Deletes one dependency") cmd.Flags().StringVarP(&flags.mod, "mod", "m", "", "Deletes one dependency")
return cmd return cmd
} }

View File

@ -20,9 +20,9 @@ var (
// rootCmd represents the base command when called without any subcommands // rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "pkgdash <command> [flags]", Use: "pkgdashcli <command> [flags]",
Short: "Pkgdash application to update dependencies.", Short: "Pkgdashcli application to update dependencies.",
Long: `Pkgdash allows you to define a version update for a dependency and start merge requests in version control systems.`, Long: `Pkgdashcli allows you to define a version update for a dependency and start merge requests in version control systems.`,
// Uncomment the following line if your bare application // Uncomment the following line if your bare application
// has an action associated with it: // has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { }, // Run: func(cmd *cobra.Command, args []string) { },

View File

@ -11,7 +11,6 @@ import (
"go.unistack.org/micro/v4/logger" "go.unistack.org/micro/v4/logger"
) )
// updateCmd represents the update command
var updateCmd = NewUpdateCommand() var updateCmd = NewUpdateCommand()
type UpdateFlags struct { type UpdateFlags struct {
@ -28,14 +27,13 @@ func NewUpdateCommand() *cobra.Command {
ctx := context.Background() ctx := context.Background()
logger.Info(ctx, "update start")
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "update", Use: "update",
Short: "Update allows you to start the process of creating a PR in the repository", Short: "Update allows you to start the process of creating a PR in the repository",
Long: ` Long: `
Update allows you to start the process of creating a PR in the repository. Update allows you to start the process of creating a PR in the repository.
Use the -a flag to update all dependencies or -m flag a specific module. Use the -a flag to update all dependencies or -m flag a specific module.
`, `,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
var err error var err error
@ -90,8 +88,8 @@ Use the -a flag to update all dependencies or -m flag a specific module.
}, },
} }
updateCmd.Flags().BoolVarP(&flags.all, "all", "a", false, "Updates everything depending") cmd.Flags().BoolVarP(&flags.all, "all", "a", false, "Updates everything depending")
updateCmd.Flags().StringVarP(&flags.mod, "mod", "m", "", "Update one dependency") cmd.Flags().StringVarP(&flags.mod, "mod", "m", "", "Update one dependency")
return cmd return cmd
} }