From e3ea070e62dfea4cbfe96029fd97fd6b6c5e2f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20V=C3=A4th?= Date: Sat, 7 Apr 2018 20:06:00 +0200 Subject: [PATCH] Fix order of files with -g --- bin/replacer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/replacer b/bin/replacer index 149f21d..8403a01 100755 --- a/bin/replacer +++ b/bin/replacer @@ -541,7 +541,7 @@ class Action: files = options.files self._search = options.search if options.grep: - options.files.append(options.replace) + options.files.insert(0, options.replace) self._replace = options.replace = None else: self._replace = options.replace @@ -591,7 +591,7 @@ def parse_args(): description = 'Interactively replace python regular expressions in files' parser = argparse.ArgumentParser(description=description) parser.add_argument('--version', '-V', action='version', - version='%(prog)s 0.1') + version='%(prog)s 0.2') parser.add_argument('--before', '-B', type=int, default=0, help=r'add lines of context before match') parser.add_argument('--after', '-A', type=int, default=0,