Moved Authors to informations package
This commit is contained in:
parent
4ed0fe289d
commit
c6f415f548
2 changed files with 46 additions and 16 deletions
19
informations/Authors.go
Normal file
19
informations/Authors.go
Normal 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",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
43
lpm-cli.go
43
lpm-cli.go
|
|
@ -5,27 +5,18 @@ import (
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"lpm-cli/informations"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
app := &cli.App{
|
app := &cli.App {
|
||||||
Name: "lotus-pm",
|
Name: "lotus-pm",
|
||||||
Usage: "Lotus Package Manager",
|
Usage: "Lotus Package Manager",
|
||||||
Authors: []*cli.Author {
|
Authors: informations.GetAuthors(),
|
||||||
{
|
|
||||||
Name: "netbenix",
|
|
||||||
Email: "netbenix@codenoodles.de",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "virusbear",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "maduut",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Copyright: "(c) 2021 LPM-Group",
|
Copyright: "(c) 2021 LPM-Group",
|
||||||
Commands: []*cli.Command{
|
Commands: []*cli.Command {
|
||||||
{
|
{
|
||||||
Name: "push",
|
Name: "push",
|
||||||
Usage: "Push a package",
|
Usage: "Push a package",
|
||||||
|
|
@ -36,7 +27,27 @@ func main(){
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
|
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
|
||||||
fmt.Printf("[ERROR] %s", err.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
|
return err
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -45,7 +56,7 @@ func main(){
|
||||||
|
|
||||||
|
|
||||||
err := app.Run(os.Args)
|
err := app.Run(os.Args)
|
||||||
if err != nil{
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in a new issue