From 758495e3ee84f5747b0635566638e256b569b1d6 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Wed, 26 Feb 2025 00:21:04 +0100 Subject: [PATCH] Start adding cli --- main.go | 22 +++++++++++++++------- src/cli/cli.go | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 src/cli/cli.go diff --git a/main.go b/main.go index 89a2458..41497ad 100644 --- a/main.go +++ b/main.go @@ -1,22 +1,22 @@ package main -import "fmt" import ( - "gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/configLoader" - "gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/setup" + "slices" + "os" + "gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/cli" ) // Attempts to connect to WebDAV server, verifying that the authentication data // 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 // 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 // to let museum-digital know about the required import configuration. -func generateImportConfigFile() string { +func generateImportConfigFile() { // string { } @@ -34,5 +34,13 @@ func uploadMediaFiles() { } 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() + } + } diff --git a/src/cli/cli.go b/src/cli/cli.go new file mode 100644 index 0000000..8bd09c3 --- /dev/null +++ b/src/cli/cli.go @@ -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 +