This repository has been archived on 2026-03-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
lotus-package-manager/lpm-cli.go
2021-10-30 17:39:01 +02:00

62 lines
No EOL
1.3 KiB
Go

package main
import (
"fmt"
"github.com/urfave/cli/v2"
"log"
"os"
"lpm-cli/informations"
)
func main(){
app := &cli.App {
Name: "lotus-pm",
Usage: "Lotus Package Manager",
Authors: informations.GetAuthors(),
Copyright: "(c) 2021 LPM-Group",
Commands: []*cli.Command {
{
Name: "push",
Usage: "Push a package",
Description: "Pushes a package to the default registry server, or to a user-defined registry server.",
HelpName: "push",
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
},
},
{
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
},
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}