mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-11 06:39:43 -06:00
rename package
This commit is contained in:
44
service.go
44
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
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user