diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-04-12 14:22:01 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-04-12 14:22:01 +0200 |
| commit | dbffcb226b95aad0d7a56a7e4982747d5bb58241 (patch) | |
| tree | e68df2ad030d23c35501cbfbe16ddea43305a904 /src | |
| parent | b057ab5462678198670b48cdd7b63ac65123e535 (diff) | |
echo command can take a -col parameter to specify the colors to use
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/commands.cc b/src/commands.cc index 15409b08..df2fd74a 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -432,10 +432,14 @@ void define_command(const CommandParameters& params, Context& context) void echo_message(const CommandParameters& params, Context& context) { + ParametersParser parser(params, { { "col", true } }, + ParametersParser::Flags::OptionsOnlyAtStart); String message; - for (auto& param : params) + for (auto& param : parser) message += param + " "; - context.print_status({ std::move(message), get_color("StatusLine") } ); + ColorPair color = get_color(parser.has_option("col") ? + parser.option_value("col") : "StatusLine"); + context.print_status({ std::move(message), color } ); } void write_debug_message(const CommandParameters& params, Context&) |
