4848
4949#include " Mesh.h"
5050
51+ #include < shellapi.h>
52+
5153#define TOOL_VERSION DIRECTX_MESH_VERSION
5254#include " CmdLineHelpers.h"
5355
@@ -58,6 +60,7 @@ namespace
5860{
5961 const wchar_t * g_ToolName = L" meshconvert" ;
6062 const wchar_t * g_Description = L" Microsoft (R) MeshConvert Command-line Tool [DirectXMesh]" ;
63+ const wchar_t * g_FeedbackURL = L" https://github.com/microsoft/DirectXMesh/issues" ;
6164
6265 enum OPTIONS : uint32_t
6366 {
@@ -236,13 +239,14 @@ HRESULT LoadFromOBJ(const wchar_t* szFilename,
236239
237240namespace
238241{
239- void PrintUsage ()
242+ void PrintUsage (bool full = false ) noexcept
240243 {
241244 PrintLogo (false , g_ToolName, g_Description);
242245
243246 static const wchar_t * const s_usage =
244- L" Usage: meshconvert <options> [--] <files>\n "
245- L" \n "
247+ L" Usage: meshconvert <options> [--] <files>\n\n " ;
248+
249+ static const wchar_t * const s_fullUsage =
246250 L" Input file type must be Wavefront Object (.obj)\n "
247251 L" \n "
248252 L" -ft <filetype>, --file-type <filetype> output file type\n "
@@ -291,6 +295,11 @@ namespace
291295
292296 wprintf (L" %ls" , s_usage);
293297
298+ if (!full)
299+ return ;
300+
301+ wprintf (L" %ls" , s_fullUsage);
302+
294303 wprintf (L" \n <normal-format>: " );
295304 PrintList (13 , g_vertexNormalFormats);
296305
@@ -323,6 +332,24 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
323332 std::locale::global (std::locale (" " ));
324333
325334 // Process command line
335+ if (argc < 2 )
336+ {
337+ PrintUsage ();
338+ return 0 ;
339+ }
340+
341+ // check for these first
342+ if (!_wcsicmp (argv[1 ], L" help" ) || !_wcsicmp (argv[1 ], L" /?" ))
343+ {
344+ PrintUsage (true );
345+ return 0 ;
346+ }
347+ else if (!_wcsicmp (argv[1 ], L" feedback" ))
348+ {
349+ std::ignore = ShellExecuteW (nullptr , L" open" , g_FeedbackURL, nullptr , nullptr , SW_SHOW);
350+ return 0 ;
351+ }
352+
326353 uint32_t dwOptions = 0 ;
327354 std::list<SConversion> conversion;
328355 bool allowOpts = true ;
@@ -402,7 +429,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
402429 return 0 ;
403430
404431 case OPT_HELP:
405- PrintUsage ();
432+ PrintUsage (true );
406433 return 0 ;
407434
408435 default :
0 commit comments