Don't use weird format specifiers
authorOrvid King <blah38621@gmail.com>
Mon, 14 Sep 2015 17:54:21 +0000 (10:54 -0700)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Mon, 14 Sep 2015 18:20:27 +0000 (11:20 -0700)
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

index 3b37990e94dbbdc9848a08da78455df523a307dd..c0499a6e6ce08f4bef623539d27c00f3c0a6d006 100644 (file)
@@ -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;