From 1ca9f29a4ca25b7a0d70bde1697b528482772a06 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Mon, 18 Nov 2019 16:47:10 +0100 Subject: Add a more helpful error message, if multiple files are found. --- patternutils/commands/patterncfg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py index 96e9ac7..5215d56 100644 --- a/patternutils/commands/patterncfg.py +++ b/patternutils/commands/patterncfg.py @@ -75,7 +75,7 @@ def remove(command: Optional[str], name: str) -> None: click.secho('No files found!', fg='red', err=True) raise SystemExit elif len(files) != 1: - click.secho('Multiple files found!', fg='red', err=True) + click.secho('Multiple files found! Please specify the command from which to remove the file.', fg='red', err=True) for f in files: click.secho(f, fg='red', err=True) raise SystemExit @@ -96,7 +96,7 @@ def view(name: str, command: str, color: bool) -> None: click.secho('No files found!', fg='red', err=True) raise SystemExit elif len(files) != 1: - click.secho('Multiple files found!', fg='red', err=True) + click.secho('Multiple files found! Please specify the command from which to view the file.', fg='red', err=True) for f in files: click.secho(f, fg='red', err=True) raise SystemExit @@ -130,7 +130,7 @@ def edit(name: str, command: str) -> None: click.secho('No files found!', fg='red', err=True) raise SystemExit elif len(files) != 1: - click.secho('Multiple files found!', fg='red', err=True) + click.secho('Multiple files found! Please specify the command from which to edit the file.', fg='red', err=True) for f in files: click.secho(f, fg='red', err=True) raise SystemExit -- cgit v1.3.1