diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-18 20:50:08 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-18 20:54:03 -0700 |
| commit | ccca198c1b1730b0241911cb56dc8e3504958b2a (patch) | |
| tree | a2dd9b8b087a09afdcecc5cbb3377bed15127eb2 /toolsrc/src/commands_help.cpp | |
| download | vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.tar.gz vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.zip | |
Initial commit
Diffstat (limited to 'toolsrc/src/commands_help.cpp')
| -rw-r--r-- | toolsrc/src/commands_help.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp new file mode 100644 index 000000000..4e1ae9c49 --- /dev/null +++ b/toolsrc/src/commands_help.cpp @@ -0,0 +1,55 @@ +#include "vcpkg_Commands.h" +#include "vcpkg.h" +#include "vcpkg_System.h" + +namespace vcpkg +{ + void version_command(const vcpkg_cmd_arguments& args) + { + args.check_max_args(0); + System::println("Vcpkg package management program version %s\n" + "\n" + "Vcpkg is provided \"as-is\" without warranty of any kind, express or implied.\n" + "All rights reserved.", vcpkg::version() + ); + exit(EXIT_SUCCESS); + } + + void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + { + args.check_max_args(1); + if (args.command_arguments.empty()) + { + print_usage(); + exit(EXIT_SUCCESS); + } + const auto& topic = args.command_arguments[0]; + if (topic == "triplet") + { + help_topic_valid_triplet(paths); + } + else + { + System::println(System::color::error, "Error: unknown topic %s", topic); + print_usage(); + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); + } + + void contact_command(const vcpkg_cmd_arguments& /*args*/) + { + System::println("Send an email to vcpkg@microsoft.com with any feedback."); + exit(EXIT_SUCCESS); + } + + void help_topic_valid_triplet(const vcpkg_paths& paths) + { + System::println("Available architecture triplets:"); + auto it = fs::directory_iterator(paths.triplets); + for (; it != fs::directory_iterator(); ++it) + { + System::println(" %s", it->path().stem().filename().string()); + } + } +} |
