diff --git a/lix/libmain/shared.cc b/lix/libmain/shared.cc index 5ac7df087..ef197502e 100644 --- a/lix/libmain/shared.cc +++ b/lix/libmain/shared.cc @@ -317,11 +317,10 @@ int handleExceptions(const std::string & programName, std::function fun) { ReceiveInterrupts receiveInterrupts; // FIXME: need better place for this - ErrorInfo::programName = baseNameOf(programName); /* Lix command line is not yet stabilized. * Explain that it is experimental and reserved for custom subcommands for now. * */ - bool onlyForSubcommands = ErrorInfo::programName == "lix"; + bool onlyForSubcommands = baseNameOf(programName) == "lix"; std::string error = ANSI_RED "error:" ANSI_NORMAL " "; try { diff --git a/lix/libutil/error.cc b/lix/libutil/error.cc index 34e2ec98f..93b188ba9 100644 --- a/lix/libutil/error.cc +++ b/lix/libutil/error.cc @@ -33,8 +33,6 @@ const std::string & BaseError::calcWhat() const } } -std::optional ErrorInfo::programName = std::nullopt; - std::ostream & operator <<(std::ostream & os, const HintFmt & hf) { return os << hf.str(); @@ -264,11 +262,7 @@ std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool s assert(false); } - // FIXME: show the program name as part of the trace? - if (einfo.programName && einfo.programName != ErrorInfo::programName) - prefix += fmt(" [%s]:" ANSI_NORMAL " ", einfo.programName.value_or("")); - else - prefix += ":" ANSI_NORMAL " "; + prefix += ":" ANSI_NORMAL " "; std::ostringstream oss; diff --git a/lix/libutil/error.hh b/lix/libutil/error.hh index d2c127ff2..dea4ecc31 100644 --- a/lix/libutil/error.hh +++ b/lix/libutil/error.hh @@ -89,8 +89,6 @@ struct ErrorInfo { unsigned int status = 1; Suggestions suggestions = {}; - - static std::optional programName; }; std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool showTrace);