From c3af384c7095f3f80374eccd29d3c54273b1617d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 15 Feb 2017 18:59:37 +0000 Subject: [PATCH] Detect when -client, -buffer or -try-client are used at the same time Fixes #1218 --- src/commands.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands.cc b/src/commands.cc index 8d98e1e0a..23db3dbce 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1522,6 +1522,11 @@ private: template void context_wrap(const ParametersParser& parser, Context& context, Func func) { + if ((int)(bool)parser.get_switch("buffer") + + (int)(bool)parser.get_switch("client") + + (int)(bool)parser.get_switch("try-client") > 1) + throw runtime_error{"Only one of -buffer, -client or -try-client can be specified"}; + // Disable these options to avoid costly code paths (and potential screen // redraws) That are useful only in interactive contexts. DisableOption disable_autoinfo(context, "autoinfo");