Abort if --tlscert, --tlskey or --tlscacert are used without --tls.

Fixes #296

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2015-01-26 17:10:13 -08:00
parent 77a9d77166
commit 8c2373a633
1 changed files with 6 additions and 0 deletions

View File

@ -77,6 +77,12 @@ func manage(c *cli.Context) {
if err != nil {
log.Fatal(err)
}
} else {
// Otherwise, if neither --tls nor --tlsverify are specified, abort if
// the other flags are passed as they will be ignored.
if c.IsSet("tlscert") || c.IsSet("tlskey") || c.IsSet("tlscacert") {
log.Fatal("--tlscert, --tlskey and --tlscacert require the use of either --tls or --tlsverify")
}
}
store := state.NewStore(path.Join(c.String("rootdir"), "state"))