2016-09-19 11:50:08 +08:00
|
|
|
#include "vcpkg_Commands.h"
|
|
|
|
#include "vcpkg_System.h"
|
|
|
|
|
2017-01-13 09:35:33 +08:00
|
|
|
namespace vcpkg::Commands
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
|
|
|
void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths)
|
|
|
|
{
|
2016-10-01 02:24:04 +08:00
|
|
|
args.check_max_arg_count(1);
|
2016-09-19 11:50:08 +08:00
|
|
|
if (args.command_arguments.empty())
|
|
|
|
{
|
2017-01-13 09:35:33 +08:00
|
|
|
Commands::Helpers::print_usage();
|
2016-09-19 11:50:08 +08:00
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
const auto& topic = args.command_arguments[0];
|
|
|
|
if (topic == "triplet")
|
|
|
|
{
|
2017-01-13 09:35:33 +08:00
|
|
|
Commands::help_topic_valid_triplet(paths);
|
2016-09-19 11:50:08 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
System::println(System::color::error, "Error: unknown topic %s", topic);
|
2017-01-13 09:35:33 +08:00
|
|
|
Commands::Helpers::print_usage();
|
2016-09-19 11:50:08 +08:00
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|