diff options
Diffstat (limited to 'src/wix/wixnative/wixnative.cpp')
| -rw-r--r-- | src/wix/wixnative/wixnative.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/wix/wixnative/wixnative.cpp b/src/wix/wixnative/wixnative.cpp index 7a689fc3..d7db20f6 100644 --- a/src/wix/wixnative/wixnative.cpp +++ b/src/wix/wixnative/wixnative.cpp | |||
| @@ -2,6 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | #include "precomp.h" | 3 | #include "precomp.h" |
| 4 | 4 | ||
| 5 | static HRESULT WixNativeReadStdinPreamble(); | ||
| 6 | |||
| 7 | |||
| 5 | int __cdecl wmain(int argc, LPWSTR argv[]) | 8 | int __cdecl wmain(int argc, LPWSTR argv[]) |
| 6 | { | 9 | { |
| 7 | HRESULT hr = E_INVALIDARG; | 10 | HRESULT hr = E_INVALIDARG; |
| @@ -11,8 +14,14 @@ int __cdecl wmain(int argc, LPWSTR argv[]) | |||
| 11 | if (argc < 2) | 14 | if (argc < 2) |
| 12 | { | 15 | { |
| 13 | ConsoleWriteError(hr, CONSOLE_COLOR_RED, "Must specify a command"); | 16 | ConsoleWriteError(hr, CONSOLE_COLOR_RED, "Must specify a command"); |
| 17 | |||
| 18 | ExitFunction(); | ||
| 14 | } | 19 | } |
| 15 | else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"smartcab", -1)) | 20 | |
| 21 | hr = WixNativeReadStdinPreamble(); | ||
| 22 | ExitOnFailure(hr, "failed to read stdin preamble"); | ||
| 23 | |||
| 24 | if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"smartcab", -1)) | ||
| 16 | { | 25 | { |
| 17 | hr = SmartCabCommand(argc - 2, argv + 2); | 26 | hr = SmartCabCommand(argc - 2, argv + 2); |
| 18 | } | 27 | } |
| @@ -33,11 +42,12 @@ int __cdecl wmain(int argc, LPWSTR argv[]) | |||
| 33 | ConsoleWriteError(hr, CONSOLE_COLOR_RED, "Unknown command: %ls", argv[1]); | 42 | ConsoleWriteError(hr, CONSOLE_COLOR_RED, "Unknown command: %ls", argv[1]); |
| 34 | } | 43 | } |
| 35 | 44 | ||
| 45 | LExit: | ||
| 36 | ConsoleUninitialize(); | 46 | ConsoleUninitialize(); |
| 37 | return HRESULT_CODE(hr); | 47 | return HRESULT_CODE(hr); |
| 38 | } | 48 | } |
| 39 | 49 | ||
| 40 | HRESULT WixNativeReadStdinPreamble() | 50 | static HRESULT WixNativeReadStdinPreamble() |
| 41 | { | 51 | { |
| 42 | HRESULT hr = S_OK; | 52 | HRESULT hr = S_OK; |
| 43 | LPWSTR sczLine = NULL; | 53 | LPWSTR sczLine = NULL; |
