Add text for --help command in CLI

Close #12
This commit is contained in:
Joshua Ramon Enslin 2025-03-06 12:12:49 +01:00
parent 0f5341835f
commit 316c79cb88
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
4 changed files with 44 additions and 5 deletions

View File

@ -11,6 +11,7 @@ import (
func main() {
if slices.Contains(os.Args, "--help") {
cli.ShowHelpText();
} else if slices.Contains(os.Args, "--version") {
cli.ShowVersion();
} else if slices.Contains(os.Args, "--check-update") {

32
src/cli/ShowHelpText.go Normal file
View File

@ -0,0 +1,32 @@
package cli
import (
"fmt"
)
func ShowHelpText() {
fmt.Println(`museum-digital uploader
A tool to manage the configuration of imports to museum-digital and simplify the upload process.
Commands:
(no command), --webui Runs a small dashboard and opens a browser to view it.
Use this for using the app without the command line.
--show-config Show current config in JSON format.
--run-manual-setup Opens a CLI-based settings dialogue.
--set-additional-setting Allows setting optional, parser-specific settings.
--upload Upload data for import.
--webdav-remote-list-toplevel Show folder contents of the WebDAV share used for imports.
--webdav-remote-list-metadata-dir Show folder contents of the WebDAV share used for imports (metadata subdirectory).
--webdav-remote-list-media-dir Show folder contents of the WebDAV share used for imports (media subdirectory).
--local-list-metadata Lists metadata files currently present in the upload directory.
--local-list-media Lists media files currently present in the upload directory.
--help Print help message.
--check-update Check for updates to this application.
Links:
Source code: https://gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader`)
}

11
src/cli/ShowVersion.go Normal file
View File

@ -0,0 +1,11 @@
package cli
import (
"fmt"
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/meta"
)
// Prints current version.
func ShowVersion() {
fmt.Println(meta.GetVersion())
}

View File

@ -372,11 +372,6 @@ func ListLocalMedia() {
}
// Prints current version.
func ShowVersion() {
fmt.Println(meta.GetVersion())
}
// Prints, if there is a current version.
func CheckVersionIsUpToDate() {