diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-07-26 16:46:22 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-07-26 16:46:22 -0700 |
| commit | 800af576df9c632053f1e71f8c16a1c3d37caec2 (patch) | |
| tree | 9a572b871d262df9c3273fe71a71c9f99be8f286 /toolsrc/src/commands_help.cpp | |
| parent | 06597edfb7e47ff16c60c6dbbecf7883294d8ecb (diff) | |
| download | vcpkg-800af576df9c632053f1e71f8c16a1c3d37caec2.tar.gz vcpkg-800af576df9c632053f1e71f8c16a1c3d37caec2.zip | |
[vcpkg-help] Improve help, including a list of topics.
Diffstat (limited to 'toolsrc/src/commands_help.cpp')
| -rw-r--r-- | toolsrc/src/commands_help.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index e4be11a77..a12f9003d 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -5,6 +5,14 @@ namespace vcpkg::Commands::Help { + void help_topics() + { + System::println("Available help topics:\n" + " triplet\n" + " integrate\n" + " export"); + } + void help_topic_valid_triplet(const VcpkgPaths& paths) { System::println("Available architecture triplets:"); @@ -14,6 +22,21 @@ namespace vcpkg::Commands::Help } } + void help_topic_export() + { + System::println("Summary:\n" + " vcpkg export [options] <pkgs>...\n" + "\n" + "Options:\n" + " --7zip Export to a 7zip (.7z) file\n" + " --dry-run Do not actually export\n" + " --nuget Export a NuGet package\n" + " --nuget-id=<id> Specify the id for the exported NuGet package\n" + " --nuget-version=<ver> Specify the version for the exported NuGet package\n" + " --raw Export to an uncompressed directory\n" + " --zip Export to a zip file"); + } + void print_usage() { System::println( @@ -25,6 +48,8 @@ namespace vcpkg::Commands::Help " vcpkg list List installed packages\n" " vcpkg update Display list of packages for updating\n" " vcpkg hash <file> [alg] Hash a file by specific algorithm, default SHA512\n" + " vcpkg help topics Display the list of help topics\n" + " vcpkg help <topic> Display help for a specific topic\n" "\n" "%s" // Integration help "\n" @@ -77,14 +102,28 @@ namespace vcpkg::Commands::Help Checks::exit_success(VCPKG_LINE_INFO); } const auto& topic = args.command_arguments[0]; - if (topic == "triplet") + if (topic == "triplet" || topic == "triplets" || topic == "triple") { help_topic_valid_triplet(paths); } + else if (topic == "export") + { + help_topic_export(); + } + else if (topic == "integrate") + { + System::print("Commands:\n" + "%s", + Integrate::INTEGRATE_COMMAND_HELPSTRING); + } + else if (topic == "topics") + { + help_topics(); + } else { System::println(System::Color::error, "Error: unknown topic %s", topic); - print_usage(); + help_topics(); Checks::exit_fail(VCPKG_LINE_INFO); } Checks::exit_success(VCPKG_LINE_INFO); |
