From 246e71fbfe4ab1181c4d74717c78213d71de859d Mon Sep 17 00:00:00 2001 From: Hubcapp Date: Wed, 1 Jul 2020 00:51:03 -0500 Subject: [PATCH] update usage help to correct flag-command order Hi, I had a problem where the suggested usage is not actually how hydroxide was able to parse flags. Currently, `hydroxide help` claims the correct order is `usage: hydroxide ` However, my flags are silently ignored when placing them in that order. ``` # hydroxide serve -smtp-port 2024 2020/07/01 01:43:20 CardDAV server listening on 127.0.0.1:8080 2020/07/01 01:43:20 SMTP server listening on 127.0.0.1:1025 2020/07/01 01:43:20 IMAP server listening on 127.0.0.1:1143 ``` So I goofed with it a while and found out that hydroxide will not ignore flags if they go *before* the command. ``` hydroxide -smtp-port 2024 serve 2020/07/01 01:44:12 CardDAV server listening on 127.0.0.1:8080 2020/07/01 01:44:12 SMTP server listening on 127.0.0.1:2024 2020/07/01 01:44:12 IMAP server listening on 127.0.0.1:1143 ``` The usage information should be changed to reflect this. --- cmd/hydroxide/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/hydroxide/main.go b/cmd/hydroxide/main.go index 080e586..0def5da 100644 --- a/cmd/hydroxide/main.go +++ b/cmd/hydroxide/main.go @@ -109,7 +109,7 @@ func listenAndServeCardDAV(addr string, authManager *auth.Manager, eventsManager return s.ListenAndServe() } -const usage = `usage: hydroxide +const usage = `usage: hydroxide Commands: auth Login to ProtonMail via hydroxide carddav Run hydroxide as a CardDAV server