From 6b8587000b99ff973ea38cb8aa713bfb2c7502d2 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Wed, 22 Mar 2017 16:47:25 +0300 Subject: [PATCH] src: Introduce a `-i` suffix flag for filter backups This commit allows the user to chose to backup the files on which a filter has been run, by specifying a suffix for the backup file. The former implementation always backed up the files with a hardcoded ".kak-bak" suffix. When no suffix is specified on the command line, the files are not saved. Fixes #1288 --- src/main.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.cc b/src/main.cc index b592a7b3..a21be6c5 100644 --- a/src/main.cc +++ b/src/main.cc @@ -642,7 +642,7 @@ int run_server(StringView session, return 0; } -int run_filter(StringView keystr, StringView commands, ConstArrayView files, bool quiet) +int run_filter(StringView keystr, StringView commands, ConstArrayView files, bool quiet, StringView suffix_backup) { StringRegistry string_registry; GlobalScope global_scope; @@ -689,7 +689,8 @@ int run_filter(StringView keystr, StringView commands, ConstArrayView files;