Put the full help before the options
authorBrian Smith <bcsmith@fb.com>
Fri, 17 Mar 2017 05:19:53 +0000 (22:19 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 17 Mar 2017 05:22:42 +0000 (22:22 -0700)
Summary: This is more in line with "traditional" output from cli tools on *nix.

Reviewed By: yfeldblum

Differential Revision: D4719055

fbshipit-source-id: 2389a4a2a49f18d4b3d0257f68036f73f8fbc49e

folly/experimental/NestedCommandLineApp.cpp

index a50374a9489366002435f7f5b82456897dd3d0be..8904f3c7a1a88d0b6a5dcff50e9764d615099e69 100644 (file)
@@ -143,14 +143,14 @@ void NestedCommandLineApp::displayHelp(
         info.argStr.empty() ? "" : " ",
         info.argStr.c_str());
 
+    printf("%s\n", info.fullHelp.c_str());
+
     std::cout << globalOptions_;
 
     if (!info.options.options().empty()) {
       printf("\n");
       std::cout << info.options;
     }
-
-    printf("\n%s\n", info.fullHelp.c_str());
   }
 }