diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-13 18:50:28 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-10-13 18:50:28 -0700 |
| commit | 0d7381ba408e4d5bcde06ab7a6353ff14e7afc0b (patch) | |
| tree | 293a786398d109ca316fc89d2f128fd80d7d5f56 /toolsrc/src/vcpkgmetricsuploader.cpp | |
| parent | 2397cc044ee56160757aeb402dc7adaec6b00894 (diff) | |
| parent | a790820e8cdf9adca3e5cf066b8a563a3beaacd1 (diff) | |
| download | vcpkg-0d7381ba408e4d5bcde06ab7a6353ff14e7afc0b.tar.gz vcpkg-0d7381ba408e4d5bcde06ab7a6353ff14e7afc0b.zip | |
Merge branch 'refactor-includes'
Diffstat (limited to 'toolsrc/src/vcpkgmetricsuploader.cpp')
| -rw-r--r-- | toolsrc/src/vcpkgmetricsuploader.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkgmetricsuploader.cpp b/toolsrc/src/vcpkgmetricsuploader.cpp new file mode 100644 index 000000000..2239fe750 --- /dev/null +++ b/toolsrc/src/vcpkgmetricsuploader.cpp @@ -0,0 +1,20 @@ +#include <vcpkg/metrics.h> + +#include <vcpkg/base/checks.h> +#include <vcpkg/base/files.h> + +#include <Windows.h> + +using namespace vcpkg; + +int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int) +{ + int argCount; + LPWSTR* szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); + + Checks::check_exit(VCPKG_LINE_INFO, argCount == 2, "Requires exactly one argument, the path to the payload file"); + auto v = Files::get_real_filesystem().read_contents(szArgList[1]).value_or_exit(VCPKG_LINE_INFO); + Metrics::g_metrics.lock()->upload(v); + LocalFree(szArgList); + return 0; +} |
