vcpkg/toolsrc/src/vcpkg_metrics_uploader.cpp

18 lines
515 B
C++
Raw Normal View History

2016-09-19 11:50:08 +08:00
#include "metrics.h"
#include "vcpkg_Checks.h"
#include "vcpkg_Files.h"
#include <Windows.h>
using namespace vcpkg;
2017-02-16 10:45:26 +08:00
int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int)
2016-09-19 11:50:08 +08:00
{
LPWSTR* szArgList;
int argCount;
szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount);
Checks::check_exit(VCPKG_LINE_INFO, argCount == 2, "Requires exactly one argument, the path to the payload file");
2017-04-04 05:26:13 +08:00
Metrics::Upload(Files::read_contents(szArgList[1]).value_or_exit(VCPKG_LINE_INFO));
2016-09-19 11:50:08 +08:00
}