aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg_metrics_uploader.cpp
blob: 63668d1d7f668e5b4daf04870cb6d496a7b40f03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "metrics.h"
#include "vcpkg_Checks.h"
#include "vcpkg_Files.h"
#include <Windows.h>

using namespace vcpkg;

int WINAPI
WinMain(
    _In_ HINSTANCE hInstance,
         _In_opt_ HINSTANCE hPrevInstance,
         _In_ LPSTR lpCmdLine,
         _In_ int nShowCmd
)
{
    LPWSTR* szArgList;
    int argCount;

    szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount);

    Checks::check_exit(argCount == 2, "Requires exactly one argument, the path to the payload file");
    Upload(Files::get_contents(szArgList[1]).get_or_throw());
}