Start adding cli

This commit is contained in:
Joshua Ramon Enslin 2025-02-26 00:21:04 +01:00
parent 5afc375042
commit 758495e3ee
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
2 changed files with 31 additions and 7 deletions

22
main.go
View File

@ -1,22 +1,22 @@
package main package main
import "fmt"
import ( import (
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/configLoader" "slices"
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/setup" "os"
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/cli"
) )
// Attempts to connect to WebDAV server, verifying that the authentication data // Attempts to connect to WebDAV server, verifying that the authentication data
// works and that the server is one for uploads with museum-digital. // works and that the server is one for uploads with museum-digital.
// A museum-digital WebDAV directory can be identified by the availability of the // A museum-digital WebDAV directory can be identified by the availability of the
// directories IMPORT_IMG and IMPORT_XML. // directories IMPORT_IMG and IMPORT_XML.
func verifyConnection(config MDWebDavUploaderConfig) bool { // func verifyConnection(config MDWebDavUploaderConfig) bool {
} // }
// Generates the contents of the file import_config.txt necessary // Generates the contents of the file import_config.txt necessary
// to let museum-digital know about the required import configuration. // to let museum-digital know about the required import configuration.
func generateImportConfigFile() string { func generateImportConfigFile() { // string {
} }
@ -34,5 +34,13 @@ func uploadMediaFiles() {
} }
func main() { func main() {
fmt.Println("hi")
if slices.Contains(os.Args, "--help") {
} else if slices.Contains(os.Args, "--cli-run-manual-setup") {
cli.runManualSetup()
} else {
cli.runManualSetup()
}
} }

16
src/cli/cli.go Normal file
View File

@ -0,0 +1,16 @@
package cli
import (
// "gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/configloader"
)
// Queries the user for each of the relevant values for setup.
func runManualSetup() {
}
// Runs the CLI workflow:
// - Check config validity