Change the message when expecting side effect

The previous behavior is really surprising:
```
    some_command* [enter/ctrl+c]
   |<~~~~~~~~~~~>|<~~~~~~~~~~~~>|
   |  bold text  | normal weight|
```
as if the '*' is part of the command to be executed.
The new behavior is:
```
    some_command (+side effect) [enter/ctrl+c]
   |<~~~~~~~~~~>|<~~~~~~~~~~~~~~~~~~~~~~~~~~~>|
   |  bold text |        normal weight        |
```
This commit is contained in:
mcarton
2015-07-25 23:10:21 +02:00
parent 1c5fef3a34
commit 3173ef10c6
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -29,19 +29,19 @@ def rule_failed(rule, exc_info, settings):
def show_command(new_command, side_effect, settings):
sys.stderr.write('{bold}{command}{side_effect}{reset}\n'.format(
sys.stderr.write('{bold}{command}{reset}{side_effect}\n'.format(
command=new_command,
side_effect='*' if side_effect else '',
side_effect=' (+side effect)' if side_effect else '',
bold=color(colorama.Style.BRIGHT, settings),
reset=color(colorama.Style.RESET_ALL, settings)))
def confirm_command(new_command, side_effect, settings):
sys.stderr.write(
'{bold}{command}{side_effect}{reset} '
'{bold}{command}{reset}{side_effect} '
'[{green}enter{reset}/{red}ctrl+c{reset}]'.format(
command=new_command,
side_effect='*' if side_effect else '',
side_effect=' (+side effect)' if side_effect else '',
bold=color(colorama.Style.BRIGHT, settings),
green=color(colorama.Fore.GREEN, settings),
red=color(colorama.Fore.RED, settings),