diff options
| author | Maxime Coste <mawww@kakoune.org> | 2023-03-14 07:39:32 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2023-03-14 09:01:13 +1100 |
| commit | 019fbc5439ad884f172c324ebc928463eab9bc74 (patch) | |
| tree | 2d4bab166e756166c13aa6374b67119bcf7b2b29 /src/commands.cc | |
| parent | 1322abef646533eb67d8c76d8a459ef48becb266 (diff) | |
Cleanup and speed up test runner
Add a -end-of-line switch to echo command to make it possible
to use `echo -end-of-line -to-file <file>` to collect env-vars
Diffstat (limited to 'src/commands.cc')
| -rw-r--r-- | src/commands.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commands.cc b/src/commands.cc index 6edc308b..f2cb1c33 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1449,6 +1449,7 @@ const CommandDesc echo_cmd = { ParameterDesc{ { { "markup", { {}, "parse markup" } }, { "quoting", { {arg_completer(Array{"raw", "kakoune", "shell"})}, "quote each argument separately using the given style (raw|kakoune|shell)" } }, + { "end-of-line", { {}, "add trailing end-of-line" } }, { "to-file", { {filename_arg_completer<false>}, "echo contents to given filename" } }, { "to-shell-script", { ArgCompleter{}, "pipe contents to given shell script" } }, { "debug", { {}, "write to debug buffer instead of status line" } } }, @@ -1466,6 +1467,9 @@ const CommandDesc echo_cmd = { else message = join(parser, ' ', false); + if (parser.get_switch("end-of-line")) + message.push_back('\n'); + if (auto filename = parser.get_switch("to-file")) write_to_file(*filename, message); else if (auto command = parser.get_switch("to-shell-script")) |
