diff options
| author | Dennis Fink | 2020-09-23 09:40:58 +0200 |
|---|---|---|
| committer | Dennis Fink | 2020-09-23 09:40:58 +0200 |
| commit | 042b00fd50e09c2610e2c1e906769ccdd45d5b9c (patch) | |
| tree | 0b33ccf807ffe6502082396832fe3eef6879ef9c | |
| parent | 7917ff35e25f7335b8ef2c64233ec3270085515f (diff) | |
| download | patternutils-042b00fd50e09c2610e2c1e906769ccdd45d5b9c.tar.gz patternutils-042b00fd50e09c2610e2c1e906769ccdd45d5b9c.zip | |
Better error message if the template/regex/command file is not found
| -rw-r--r-- | patternutils/commands/pmatch.py | 2 | ||||
| -rw-r--r-- | patternutils/commands/targs.py | 2 | ||||
| -rw-r--r-- | patternutils/commands/tln.py | 2 | ||||
| -rw-r--r-- | patternutils/commands/tmv.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/patternutils/commands/pmatch.py b/patternutils/commands/pmatch.py index c276bf3..6bbd349 100644 --- a/patternutils/commands/pmatch.py +++ b/patternutils/commands/pmatch.py @@ -121,7 +121,7 @@ def pmatch( try: regex_pattern, _ = config.load_template(regex_pattern, "pmatch") except FileNotFoundError: - click.secho("File not found!", fg="red", err=True) + click.secho(f"Regex {regex_pattern} not found!", fg="red", err=True) raise SystemExit except RuntimeError: click.secho("Multiple files found!", fg="red", err=True) diff --git a/patternutils/commands/targs.py b/patternutils/commands/targs.py index 4ec9a17..a3b3a02 100644 --- a/patternutils/commands/targs.py +++ b/patternutils/commands/targs.py @@ -86,7 +86,7 @@ def targs( try: command, template_engine = config.load_template(command, "targs") except FileNotFoundError: - click.secho("File not found!", fg="red", err=True) + click.secho(f"Command {command} not found!", fg="red", err=True) raise SystemExit except RuntimeError: click.secho("Multiple files found!", fg="red", err=True) diff --git a/patternutils/commands/tln.py b/patternutils/commands/tln.py index e84ddb4..295cda9 100644 --- a/patternutils/commands/tln.py +++ b/patternutils/commands/tln.py @@ -118,7 +118,7 @@ def tln( output_pattern, "tln" ) except FileNotFoundError: - click.secho("File not found!", fg="red", err=True) + click.secho(f"Template {output_pattern} not found!", fg="red", err=True) raise SystemExit except RuntimeError: click.secho("Multiple files found!", fg="red", err=True) diff --git a/patternutils/commands/tmv.py b/patternutils/commands/tmv.py index 1b25441..3e92342 100644 --- a/patternutils/commands/tmv.py +++ b/patternutils/commands/tmv.py @@ -114,7 +114,7 @@ def tmv( output_pattern, "tmv" ) except FileNotFoundError: - click.secho("File not found!", fg="red", err=True) + click.secho(f"Template {output_pattern} not found!", fg="red", err=True) raise SystemExit except RuntimeError: click.secho("Multiple files found!", fg="red", err=True) |
