From abece752484ae7fbfc4edfa1e10d52f86d07f3fe Mon Sep 17 00:00:00 2001 From: Orvid King Date: Mon, 14 Sep 2015 10:54:21 -0700 Subject: [PATCH] Don't use weird format specifiers Summary: MSVC doesn't like it when you use `%1$s`, and actually emits a warning at compile time, so pass the second arugment twice instead. Closes https://github.com/facebook/folly/pull/302 Reviewed By: @yfeldblum Differential Revision: D2371262 Pulled By: @JoelMarcey --- folly/experimental/NestedCommandLineApp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/experimental/NestedCommandLineApp.cpp b/folly/experimental/NestedCommandLineApp.cpp index 3b37990e..c0499a6e 100644 --- a/folly/experimental/NestedCommandLineApp.cpp +++ b/folly/experimental/NestedCommandLineApp.cpp @@ -130,8 +130,8 @@ void NestedCommandLineApp::displayHelp( // Help for a given command auto& p = findCommand(args.front()); if (p.first != args.front()) { - printf("`%1$s' is an alias for `%2$s'; showing help for `%2$s'\n", - args.front().c_str(), p.first.c_str()); + printf("`%s' is an alias for `%s'; showing help for `%s'\n", + args.front().c_str(), p.first.c_str(), p.first.c_str()); } auto& info = p.second; -- 2.34.1