From: Gabe Black Date: Sun, 5 Apr 2020 09:27:42 +0000 (-0700) Subject: util: c++-ify usage printing in the m5 utility. X-Git-Tag: v20.1.0.0~399 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cafaccc9d12f0f456f8b2fd9963850b7b373975a;p=gem5.git util: c++-ify usage printing in the m5 utility. Change-Id: Ice8641d490fa9a510a6f1e246530ca5c82ef8170 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27555 Reviewed-by: Jason Lowe-Power Reviewed-by: Daniel Carvalho Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/util/m5/src/usage.cc b/util/m5/src/usage.cc index 60ceedf2f..bbcf36af3 100644 --- a/util/m5/src/usage.cc +++ b/util/m5/src/usage.cc @@ -38,9 +38,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include +#include #include "call_type.hh" #include "commands.hh" @@ -51,16 +50,16 @@ std::string progname; void usage() { - fprintf(stderr, "Usage: %s [call type] [arguments]\n", - progname.c_str()); - fprintf(stderr, "\n"); - fprintf(stderr, "Call types:\n"); - fprintf(stderr, CallType::usageSummary().c_str()); - fprintf(stderr, "\n"); - fprintf(stderr, "Commands:\n"); - fprintf(stderr, Command::usageSummary().c_str()); - fprintf(stderr, "\n"); - fprintf(stderr, "All times in nanoseconds!\n"); + std::cerr << "Usage: " << progname << + "[call type] [arguments]" << std::endl << + std::endl << + "Call types:" << std::endl << + CallType::usageSummary() << + std::endl << + "Commands:" << std::endl << + Command::usageSummary() << + std::endl << + "All times in nanoseconds!" << std::endl; exit(1); }