cmd/hydroxide: fix sub-command arg processing

This commit is contained in:
Simon Ser 2020-03-07 17:54:40 +01:00
parent ea106494fe
commit 87dbf04035
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ func main() {
cmd := flag.Arg(0)
switch cmd {
case "auth":
authCmd.Parse(os.Args[2:])
authCmd.Parse(flag.Args()[1:])
username := authCmd.Arg(0)
if username == "" {
log.Fatal("usage: hydroxide auth <username>")
@ -267,7 +267,7 @@ func main() {
}
}
case "export-secret-keys":
exportSecretKeysCmd.Parse(os.Args[2:])
exportSecretKeysCmd.Parse(flag.Args()[1:])
username := exportSecretKeysCmd.Arg(0)
if username == "" {
log.Fatal("usage: hydroxide export-secret-keys <username>")
@ -303,7 +303,7 @@ func main() {
case "import-messages":
// TODO: support for mbox
importMessagesCmd.Parse(os.Args[2:])
importMessagesCmd.Parse(flag.Args()[1:])
username := importMessagesCmd.Arg(0)
archivePath := importMessagesCmd.Arg(1)
if username == "" || archivePath == "" {