/* Re-throw the error, but with the file name information
prepended. */
throw_error (e.error,
- _("%s:%d: Error in sourced command file:\n%s"),
- source_file_name.c_str (), source_line_number,
+ _("%ps:%ps: Error in sourced command file:\n%s"),
+ styled_string (file_name_style.style (),
+ source_file_name.c_str ()),
+ styled_string (line_number_style.style (),
+ plongest (source_line_number)),
e.what ());
}
}
#include "interps.h"
#include "target.h"
#include "arch-utils.h"
+#include "cli/cli-style.h"
#include "cli/cli-utils.h"
#include "filenames.h"
#include "ada-lang.h"
if (filename)
throw_error (NOT_FOUND_ERROR,
_("Undefined convenience variable or function \"%s\" "
- "not defined in \"%s\"."), symbol, filename);
+ "not defined in \"%ps\"."), symbol,
+ styled_string (file_name_style.style (), filename));
else
throw_error (NOT_FOUND_ERROR,
_("Undefined convenience variable or function \"%s\" "
{
if (filename)
throw_error (NOT_FOUND_ERROR,
- _("Function \"%s\" not defined in \"%s\"."),
- symbol, filename);
+ _("Function \"%s\" not defined in \"%ps\"."),
+ symbol,
+ styled_string (file_name_style.style (), filename));
else
throw_error (NOT_FOUND_ERROR,
_("Function \"%s\" not defined."), symbol);
[[noreturn]] static void
source_file_not_found_error (const char *name)
{
- throw_error (NOT_FOUND_ERROR, _("No source file named %s."), name);
+ throw_error (NOT_FOUND_ERROR, _("No source file named %ps."),
+ styled_string (file_name_style.style (), name));
}
/* Unless at EIO, save the current stream position as completion word
{
if (ls->explicit_loc.source_filename)
throw_error (NOT_FOUND_ERROR,
- _("No compiled code for line %d in file \"%s\"."),
- line, ls->explicit_loc.source_filename.get ());
+ _("No compiled code for line %ps in file \"%ps\"."),
+ styled_string (line_number_style.style (),
+ plongest (line)),
+ styled_string (file_name_style.style (),
+ ls->explicit_loc.source_filename.get ()));
else
throw_error (NOT_FOUND_ERROR,
- _("No compiled code for line %d in the current file."),
- line);
+ _("No compiled code for line %ps in the current file."),
+ styled_string (line_number_style.style (),
+ plongest (line)));
}
return values;