emersion / hydroxide

A third-party, open-source ProtonMail CardDAV, IMAP and SMTP bridge
MIT License
1.64k stars 126 forks source link

`hydroxide help` and `hydroxide -h` show different outputs #136

Closed PRESFIL closed 3 years ago

PRESFIL commented 3 years ago

With -h option:

$  hydroxide -h
Usage of hydroxide:
  -carddav-host string
        Allowed CardDAV email hostname on which hydroxide listens, defaults to 127.0.0.1 (default "127.0.0.1")
  -carddav-port string
        CardDAV port on which hydroxide listens, defaults to 8080 (default "8080")
  -debug
        Enable debug logs
  -imap-host string
        Allowed IMAP email hostname on which hydroxide listens, defaults to 127.0.0.1 (default "127.0.0.1")
  -imap-port string
        IMAP port on which hydroxide listens, defaults to 1143 (default "1143")
  -smtp-host string
        Allowed SMTP email hostname on which hydroxide listens, defaults to 127.0.0.1 (default "127.0.0.1")
  -smtp-port string
        SMTP port on which hydroxide listens, defaults to 1025 (default "1025")

With --help long-option:

$  hydroxide --help
Usage of hydroxide:
  -carddav-host string
        Allowed CardDAV email hostname on which hydroxide listens, defaults to 127.0.0.1 (default "127.0.0.1")
  -carddav-port string
        CardDAV port on which hydroxide listens, defaults to 8080 (default "8080")
  -debug
        Enable debug logs
  -imap-host string
        Allowed IMAP email hostname on which hydroxide listens, defaults to 127.0.0.1 (default "127.0.0.1")
  -imap-port string
        IMAP port on which hydroxide listens, defaults to 1143 (default "1143")
  -smtp-host string
        Allowed SMTP email hostname on which hydroxide listens, defaults to 127.0.0.1 (default "127.0.0.1")
  -smtp-port string
        SMTP port on which hydroxide listens, defaults to 1025 (default "1025")

On the contrary, with help command:

$  hydroxide help
2020/12/26 21:57:48 usage: hydroxide [options...] <command>
Commands:
    auth <username>     Login to ProtonMail via hydroxide
    carddav         Run hydroxide as a CardDAV server
    export-secret-keys <username> Export secret keys
    imap            Run hydroxide as an IMAP server
    import-messages <username> <file>   Import messages
    export-messages [options...] <username> Export messages
    serve           Run all servers
    smtp            Run hydroxide as an SMTP server
    status          View hydroxide status

Global options:
    -debug
        Enable debug logs
    -smtp-host example.com
        Allowed SMTP email hostname on which hydroxide listens, defaults to 127.0.0.1
    -imap-host example.com
        Allowed IMAP email hostname on which hydroxide listens, defaults to 127.0.0.1
    -carddav-host example.com
        Allowed SMTP email hostname on which hydroxide listens, defaults to 127.0.0.1
    -smtp-port example.com
        SMTP port on which hydroxide listens, defaults to 1025
    -imap-port example.com
        IMAP port on which hydroxide listens, defaults to 1143
    -carddav-port example.com
        CardDAV port on which hydroxide listens, defaults to 8080

I don't think it's meant to be, isn't it ?

Also, there nothing about help, -h, --help keys/commands.


hydroxide version: 0.2.17

emersion commented 3 years ago

We'll probably want to set flag.Usage here.

emersion commented 3 years ago

Fixed in https://github.com/emersion/hydroxide/commit/b812444ff81378f01d76d82497fcf5d4b410429c.

PRESFIL commented 3 years ago

Thanks, part of issue fixed.

But,

Also, there nothing about help, -h, --help keys/commands.

emersion commented 3 years ago

Send a PR?

PRESFIL commented 3 years ago

Nope. I see there are some differences between the UNIX/Gnu help/options formats and those promoted by Go. Therefore, it seems to me that you know better.