From f7b3b4dcbb2829961138ec987e11fc7056fbe189 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 21 Aug 2019 16:00:25 +0200 Subject: [PATCH] rename package --- service.go | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/service.go b/service.go index 06ec2dbe4f..de0464b877 100644 --- a/service.go +++ b/service.go @@ -1,4 +1,4 @@ -package main +package service import ( "os" @@ -7,15 +7,15 @@ import ( "github.com/spf13/cobra" ) -func main() { +// func main() { - revaphoenixCommand, allCommandFns := NewRevaPhoenixCommand() +// revaphoenixCommand, allCommandFns := NewRevaPhoenixCommand() - basename := filepath.Base(os.Args[0]) - if err := commandFor(basename, revaphoenixCommand, allCommandFns).Execute(); err != nil { - os.Exit(1) - } -} +// basename := filepath.Base(os.Args[0]) +// if err := commandFor(basename, revaphoenixCommand, allCommandFns).Execute(); err != nil { +// os.Exit(1) +// } +// } // NewRevaPhoenixCommand is the entry point for reva-phoenix func NewRevaPhoenixCommand() (*cobra.Command, []func() *cobra.Command) { @@ -35,18 +35,18 @@ func NewRevaPhoenixCommand() (*cobra.Command, []func() *cobra.Command) { return cmd, nil } -func commandFor(basename string, defaultCommand *cobra.Command, commands []func() *cobra.Command) *cobra.Command { - for _, commandFn := range commands { - command := commandFn() - if command.Name() == basename { - return command - } - for _, alias := range command.Aliases { - if alias == basename { - return command - } - } - } +// func commandFor(basename string, defaultCommand *cobra.Command, commands []func() *cobra.Command) *cobra.Command { +// for _, commandFn := range commands { +// command := commandFn() +// if command.Name() == basename { +// return command +// } +// for _, alias := range command.Aliases { +// if alias == basename { +// return command +// } +// } +// } - return defaultCommand -} +// return defaultCommand +// }