2017-10-13 18:37:41 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vcpkg/build.h>
|
|
|
|
#include <vcpkg/dependencies.h>
|
|
|
|
#include <vcpkg/statusparagraphs.h>
|
|
|
|
#include <vcpkg/vcpkgcmdarguments.h>
|
|
|
|
#include <vcpkg/vcpkgpaths.h>
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
namespace vcpkg::Commands
|
|
|
|
{
|
|
|
|
using CommandTypeA = void (*)(const VcpkgCmdArguments& args,
|
|
|
|
const VcpkgPaths& paths,
|
|
|
|
const Triplet& default_triplet);
|
|
|
|
using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
using CommandTypeC = void (*)(const VcpkgCmdArguments& args);
|
|
|
|
|
|
|
|
namespace BuildExternal
|
|
|
|
{
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace CI
|
|
|
|
{
|
2017-11-02 15:20:42 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Env
|
|
|
|
{
|
2017-11-02 15:20:42 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Create
|
|
|
|
{
|
2017-11-02 15:20:42 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
2017-12-13 05:43:00 -08:00
|
|
|
namespace Upgrade
|
|
|
|
{
|
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
|
|
|
|
}
|
|
|
|
|
2017-10-13 18:37:41 -07:00
|
|
|
namespace Edit
|
|
|
|
{
|
2017-10-14 02:16:55 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace DependInfo
|
|
|
|
{
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Search
|
|
|
|
{
|
2017-11-02 15:20:42 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace List
|
|
|
|
{
|
2017-11-02 15:20:42 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Owns
|
|
|
|
{
|
2017-11-02 15:20:42 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Cache
|
|
|
|
{
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Import
|
|
|
|
{
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Integrate
|
|
|
|
{
|
|
|
|
extern const char* const INTEGRATE_COMMAND_HELPSTRING;
|
2017-10-17 02:59:55 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace PortsDiff
|
|
|
|
{
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Autocomplete
|
|
|
|
{
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Version
|
|
|
|
{
|
2017-12-13 11:02:04 -08:00
|
|
|
const char* base_version();
|
2017-10-13 18:37:41 -07:00
|
|
|
const std::string& version();
|
|
|
|
void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths);
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Contact
|
|
|
|
{
|
2017-11-02 15:20:42 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 18:37:41 -07:00
|
|
|
const std::string& email();
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Hash
|
|
|
|
{
|
2017-12-23 17:26:05 +03:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
2017-10-13 18:37:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
struct PackageNameAndFunction
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
T function;
|
|
|
|
};
|
|
|
|
|
|
|
|
Span<const PackageNameAndFunction<CommandTypeA>> get_available_commands_type_a();
|
|
|
|
Span<const PackageNameAndFunction<CommandTypeB>> get_available_commands_type_b();
|
|
|
|
Span<const PackageNameAndFunction<CommandTypeC>> get_available_commands_type_c();
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
T find(const std::string& command_name, const std::vector<PackageNameAndFunction<T>> available_commands)
|
|
|
|
{
|
|
|
|
for (const PackageNameAndFunction<T>& cmd : available_commands)
|
|
|
|
{
|
|
|
|
if (cmd.name == command_name)
|
|
|
|
{
|
|
|
|
return cmd.function;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// not found
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|