From ee110eda770798e7d70d934eace248bea76ebeba Mon Sep 17 00:00:00 2001 From: Gustavo Padovan Date: Fri, 13 Dec 2024 12:01:47 -0300 Subject: [PATCH] msg: use kci_err for error messages in main.py Signed-off-by: Gustavo Padovan --- kcidev/libs/common.py | 5 ++--- kcidev/main.py | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/kcidev/libs/common.py b/kcidev/libs/common.py index 8ae6b8b..f4fad27 100644 --- a/kcidev/libs/common.py +++ b/kcidev/libs/common.py @@ -27,9 +27,8 @@ def load_toml(settings): config = toml.load(f) if not config: - click.secho( - f"No `{fname}` configuration file found at `{global_path}`, `{user_path}` or `{settings}`", - fg="red", + kci_err( + f"No `{fname}` configuration file found at `{global_path}`, `{user_path}` or `{settings}`" ) raise click.Abort() diff --git a/kcidev/main.py b/kcidev/main.py index 544b2a5..3acfff8 100755 --- a/kcidev/main.py +++ b/kcidev/main.py @@ -34,12 +34,10 @@ def cli(ctx, settings, instance): else: ctx.obj["INSTANCE"] = ctx.obj["CFG"].get("default_instance") if not ctx.obj["INSTANCE"]: - click.secho("No instance defined in settings or as argument", fg="red") + kci_err("No instance defined in settings or as argument") raise click.Abort() if ctx.obj["INSTANCE"] not in ctx.obj["CFG"]: - click.secho( - f"Instance {ctx.obj['INSTANCE']} not found in {settings}", fg="red" - ) + kci_err(f"Instance {ctx.obj['INSTANCE']} not found in {settings}") raise click.Abort() pass