Print custom lines of API support on the version string of renderdoccmd

* An easy way to check what support is compiled into this binary.
This commit is contained in:
baldurk
2016-08-25 12:57:17 +02:00
parent 6819f22181
commit 90604c6d9c
5 changed files with 83 additions and 7 deletions
+13 -3
View File
@@ -153,6 +153,8 @@ static int command_usage(std::string command = "")
return 2;
}
static std::vector<std::string> version_lines;
struct VersionCommand : public Command
{
virtual void AddOptions(cmdline::parser &parser) {}
@@ -161,13 +163,21 @@ struct VersionCommand : public Command
virtual bool IsCaptureCommand() { return false; }
virtual int Execute(cmdline::parser &parser, const CaptureOptions &)
{
std::cout << "renderdoccmd " << RENDERDOC_GetVersionString()
<< (sizeof(uintptr_t) == sizeof(uint64_t) ? " x64 " : " x86 ")
<< RENDERDOC_GetCommitHash() << std::endl;
std::cout << "renderdoccmd " << (sizeof(uintptr_t) == sizeof(uint64_t) ? "x64 " : "x86 ")
<< RENDERDOC_GetVersionString() << "-" << RENDERDOC_GetCommitHash() << std::endl;
for(size_t i = 0; i < version_lines.size(); i++)
std::cout << version_lines[i] << std::endl;
return 0;
}
};
void add_version_line(const std::string &str)
{
version_lines.push_back(str);
}
struct HelpCommand : public Command
{
virtual void AddOptions(cmdline::parser &parser) {}