bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 166 forks source link

Servers option for multiple servers #143

Closed cbartholomee closed 10 years ago

cbartholomee commented 10 years ago

Is it possible to provide multiple uir's using the --servers option?

I tried following syntaxes:

genghisapp --servers URI-1 URI-2 genghisapp --servers "URI-1 URI-2" genghisapp --servers URI-1 --servers URI-2 genghisapp --servers "URI-1" --servers "URI-2"

For all these commands behavior is the same: they all result in only one link appearing in the interface instead of two and no error or warnings are printed on stdout.

If only one uri can be specified, the plural form of this option is rather confusing and the help instructions could be more clear about it.

Thanks!

genghisapp --version

'genghisapp' 2.3.8 rack 1.2 sinatra 1.4.3 vegas 0.1.11

bobthecow commented 10 years ago

IIRC, it's comma separated URIs:

genghisapp --servers URI-1,URI-2
cbartholomee commented 10 years ago

Thank you for helping me. I have one additional question: what if the uri contains comma's? Should I wrap it between quotes? Like:

genghisapp --servers "user:pass@host1,host2,host3","user:pass@hostX,hostY,hostZ"
bobthecow commented 10 years ago

No, it wouldn't be commas, because commas are needed for replica sets. I'll check when I get back to a computer :)

bobthecow commented 10 years ago

Got it. It's semicolons :)

genghisapp --servers "user:pass@host1,host2,host3;user:pass@hostX,hostY,hostZ"

How's this for better help text?

-s, --servers SERVERS    Set a semicolon delimited list of default servers
cbartholomee commented 10 years ago

That should help already. Or maybe something like this:

-s, --servers URI[;URI]    Set a semicolon delimited list of default servers
cbartholomee commented 10 years ago

Just found out the whole list should be wrapped between quotes. Otherwise bash complains for the second, third, etc uri in your list: bash: user:pass@host: No such file or directory So help text should look like: -s, --servers "SERVERS" Set a semicolon delimited list of default servers Or: -s, --servers "URI[;URI]" Set a semicolon delimited list of default servers

bobthecow commented 10 years ago

That would be nice. Unfortunately I don't have control over anything besides the description on the right. Everything else is specified by the library that handles options parsing for me.