Moved Authors to informations package

This commit is contained in:
netbenix 2021-10-30 17:39:01 +02:00
parent 4ed0fe289d
commit c6f415f548
2 changed files with 46 additions and 16 deletions

19
informations/Authors.go Normal file
View file

@ -0,0 +1,19 @@
package informations
import "github.com/urfave/cli/v2"
func GetAuthors() []*cli.Author{
return []*cli.Author {
{
Name: "netbenix",
Email: "netbenix@codenoodles.de",
},
{
Name: "virusbear",
},
{
Name: "maduut",
},
}
}

View file

@ -5,25 +5,16 @@ import (
"github.com/urfave/cli/v2"
"log"
"os"
"lpm-cli/informations"
)
func main(){
app := &cli.App {
Name: "lotus-pm",
Usage: "Lotus Package Manager",
Authors: []*cli.Author {
{
Name: "netbenix",
Email: "netbenix@codenoodles.de",
},
{
Name: "virusbear",
},
{
Name: "maduut",
},
},
Authors: informations.GetAuthors(),
Copyright: "(c) 2021 LPM-Group",
Commands: []*cli.Command {
{
@ -36,7 +27,27 @@ func main(){
return nil
},
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
if err != nil{
fmt.Printf("[ERROR] %s", err.Error())
log.Fatal(err)
}
return err
},
},
{
Name: "pull",
Usage: "Pull a package",
Description: "Pulls a package from the default registry server, or to a user-defined registry server.",
HelpName: "pull",
Action: func(c *cli.Context) error {
//Do Stuff
return nil
},
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
if err != nil {
fmt.Printf("[ERROR] %s", err.Error())
log.Fatal(err)
}
return err
},
},