41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package main
|
|
|
|
import (
|
|
"slices"
|
|
"os"
|
|
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/cli"
|
|
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/webui"
|
|
)
|
|
|
|
// Negotiates commands based on command line options.
|
|
func main() {
|
|
|
|
if slices.Contains(os.Args, "--help") {
|
|
} else if slices.Contains(os.Args, "--version") {
|
|
cli.ShowVersion();
|
|
} else if slices.Contains(os.Args, "--show-config") {
|
|
cli.ShowCurrentConfig()
|
|
} else if slices.Contains(os.Args, "--run-manual-setup") {
|
|
cli.RunManualSetup()
|
|
} else if slices.Contains(os.Args, "--set-additional-setting") {
|
|
cli.SetAdditionalSetting()
|
|
} else if slices.Contains(os.Args, "--upload") {
|
|
cli.HandleUpload()
|
|
} else if slices.Contains(os.Args, "--webdav-remote-list-toplevel") {
|
|
cli.ListRemoteToplevel()
|
|
} else if slices.Contains(os.Args, "--webdav-remote-list-metadata-dir") {
|
|
cli.ListRemoteMetadataDir()
|
|
} else if slices.Contains(os.Args, "--webdav-remote-list-media-dir") {
|
|
cli.ListRemoteMediaDir()
|
|
} else if slices.Contains(os.Args, "--local-list-metadata") {
|
|
cli.ListLocalMetadata()
|
|
} else if slices.Contains(os.Args, "--local-list-media") {
|
|
cli.ListLocalMedia()
|
|
} else if slices.Contains(os.Args, "--webui") {
|
|
webui.Run()
|
|
} else {
|
|
// cli.RunManualSetup()
|
|
}
|
|
|
|
}
|