diff options
Diffstat (limited to '')
| -rw-r--r-- | patternutils/commands/pmatch.py | 6 | ||||
| -rw-r--r-- | patternutils/commands/targs.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/patternutils/commands/pmatch.py b/patternutils/commands/pmatch.py index 544ec75..21f5557 100644 --- a/patternutils/commands/pmatch.py +++ b/patternutils/commands/pmatch.py @@ -35,7 +35,7 @@ def apply_regex( try: match = patternutils.match.apply(subject, regex_pattern) except ValueError: - click.secho('{} did not match'.format(subject), fg='red') + click.secho('{} did not match'.format(subject), fg='red', err=True) has_invalid_matches = True else: match['_path'] = f.path @@ -76,8 +76,8 @@ def pmatch( regex_pattern_c = re.compile(regex_pattern) except re.error as e: if verbose: - click.secho('Regular expression could not be compiled!', fg='red') - click.secho(e.msg, fg='red') + click.secho('Regular expression could not be compiled!', fg='red', err=True) + click.secho(e.msg, fg='red', err=True) raise SystemExit # Monkey patch walk function to include commandline options diff --git a/patternutils/commands/targs.py b/patternutils/commands/targs.py index 41334ed..bfacbfc 100644 --- a/patternutils/commands/targs.py +++ b/patternutils/commands/targs.py @@ -34,14 +34,14 @@ def targs( try: data = json.load(read_from) except json.JSONDecodeError: - click.secho('JSON not valid!', fg='red') + click.secho('JSON not valid!', fg='red', err=True) raise SystemExit use_jinja = True if template_engine == 'jinja2' else False try: render = patternutils.template.get_render_function(command, use_jinja=use_jinja) except RuntimeError: - click.secho('jinja2 not installed!', fg='red') + click.secho('jinja2 not installed!', fg='red', err=True) raise SystemExit for r in data: |
