mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-04 11:19:39 -06:00
35 lines
832 B
Go
35 lines
832 B
Go
package command
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/owncloud/ocis/v2/extensions/webdav/pkg/command"
|
|
"github.com/owncloud/ocis/v2/ocis-pkg/config"
|
|
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
|
|
"github.com/owncloud/ocis/v2/ocis/pkg/register"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// WebDAVCommand is the entrypoint for the webdav command.
|
|
func WebDAVCommand(cfg *config.Config) *cli.Command {
|
|
|
|
return &cli.Command{
|
|
Name: cfg.WebDAV.Service.Name,
|
|
Usage: subcommandDescription(cfg.WebDAV.Service.Name),
|
|
Category: "extensions",
|
|
Before: func(c *cli.Context) error {
|
|
if err := parser.ParseConfig(cfg); err != nil {
|
|
fmt.Printf("%v", err)
|
|
return err
|
|
}
|
|
cfg.WebDAV.Commons = cfg.Commons
|
|
return nil
|
|
},
|
|
Subcommands: command.GetCommands(cfg.WebDAV),
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
register.AddCommand(WebDAVCommand)
|
|
}
|