mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-01 01:41:13 -06:00
39 lines
749 B
Go
39 lines
749 B
Go
package command
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/owncloud/ocis/ocis-pkg/clihelper"
|
|
"github.com/owncloud/ocis/ocis-pkg/config"
|
|
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
|
"github.com/owncloud/ocis/ocis/pkg/register"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// Execute is the entry point for the ocis command.
|
|
func Execute() error {
|
|
cfg := config.DefaultConfig()
|
|
|
|
app := clihelper.DefaultApp(&cli.App{
|
|
Name: "ocis",
|
|
Usage: "ownCloud Infinite Scale Stack",
|
|
Before: func(c *cli.Context) error {
|
|
return parser.ParseConfig(cfg)
|
|
},
|
|
})
|
|
|
|
for _, fn := range register.Commands {
|
|
app.Commands = append(
|
|
app.Commands,
|
|
fn(cfg),
|
|
)
|
|
}
|
|
|
|
cli.HelpFlag = &cli.BoolFlag{
|
|
Name: "help,h",
|
|
Usage: "Show the help",
|
|
}
|
|
|
|
return app.Run(os.Args)
|
|
}
|