fix: Leaking color in bench --help

Since the character to render NC was cut off due to the char limit, the
whole list of following commands and descriptions would also turn
yellow. Let's keep it colourless in --help. Only, make it yellow when
the command is executed directly.
This commit is contained in:
Gavin D'souza 2021-10-14 17:33:35 +05:30
parent bc9b3e826b
commit 6712bd9c93

View file

@ -12,10 +12,9 @@ from frappe.exceptions import SiteNotSpecifiedError
from frappe.utils import update_progress_bar, cint
from frappe.coverage import CodeCoverage
DATA_IMPORT_DEPRECATION = click.style(
DATA_IMPORT_DEPRECATION = (
"[DEPRECATED] The `import-csv` command used 'Data Import Legacy' which has been deprecated.\n"
"Use `data-import` command instead to import data via 'Data Import'.",
fg="yellow"
"Use `data-import` command instead to import data via 'Data Import'."
)
@ -364,7 +363,7 @@ def import_doc(context, path, force=False):
@click.option('--no-email', default=True, is_flag=True, help='Send email if applicable')
@pass_context
def import_csv(context, path, only_insert=False, submit_after_import=False, ignore_encoding_errors=False, no_email=True):
click.secho(DATA_IMPORT_DEPRECATION)
click.secho(DATA_IMPORT_DEPRECATION, fg="yellow")
sys.exit(1)