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"
|
||||
"log"
|
||||
"os"
|
||||
"lpm-cli/informations"
|
||||
)
|
||||
|
||||
|
||||
|
||||
func main(){
|
||||
app := &cli.App{
|
||||
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{
|
||||
Commands: []*cli.Command {
|
||||
{
|
||||
Name: "push",
|
||||
Usage: "Push a package",
|
||||
|
|
@ -36,7 +27,27 @@ func main(){
|
|||
return nil
|
||||
},
|
||||
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
|
||||
},
|
||||
},
|
||||
|
|
@ -45,7 +56,7 @@ func main(){
|
|||
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil{
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in a new issue