From ce3a0da1a3b9ea5f2835d5901276fea9c438b1da Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 8 Aug 2017 21:21:31 -0400 Subject: [PATCH] Ensure migrator does not mangle `cli.CommandsByName` --- cli-v1-to-v2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli-v1-to-v2 b/cli-v1-to-v2 index aa83461..b815295 100755 --- a/cli-v1-to-v2 +++ b/cli-v1-to-v2 @@ -236,7 +236,11 @@ def _flag_name_stringly_repl(match): @_migrator def _commands_opaque_type(source): - return re.sub('cli\\.Commands', '[]*cli.Command', source, flags=re.UNICODE) + return _subfmt( + 'cli\\.Commands(?P[^B])', + '[]*cli.Command{suffix}', + source + ) @_migrator