From 2f5a3fa16fa79889534686606935b8a723f77c8b Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Thu, 16 Apr 2020 15:06:47 +0100 Subject: [PATCH] winecfg: Add /? parameter to print help and valid versions. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41559 Signed-off-by: Owen Rudge Signed-off-by: Alexandre Julliard --- programs/winecfg/appdefaults.c | 10 ++++++++++ programs/winecfg/main.c | 14 ++++++++++++++ programs/winecfg/winecfg.h | 1 + 3 files changed, 25 insertions(+) diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c index 050b0e029d3..1ac2985a110 100644 --- a/programs/winecfg/appdefaults.c +++ b/programs/winecfg/appdefaults.c @@ -484,6 +484,16 @@ BOOL set_winver_from_string(const char *version) return FALSE; } +void print_windows_versions(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(win_versions); i++) + { + printf(" %10s %s\n", win_versions[i].szVersion, win_versions[i].szDescription); + } +} + static void on_winver_change(HWND dialog) { int selection = SendDlgItemMessageW(dialog, IDC_WINVER, CB_GETCURSEL, 0, 0); diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c index c5d4807e939..c6947bc0425 100644 --- a/programs/winecfg/main.c +++ b/programs/winecfg/main.c @@ -202,6 +202,20 @@ ProcessCmdLine(LPSTR lpCmdLine) return set_winver_from_string(&lpCmdLine[3]); } + if (lpCmdLine[1] == '?') + { + printf("Usage: winecfg [options]\n\n"); + printf("Options:\n"); + printf(" [no option] Launch the graphical version of this program.\n"); + printf(" /D Autodetect drives.\n"); + printf(" /v version Set global Windows version to 'version'.\n"); + printf(" /? Display this information and exit.\n\n"); + printf("Valid versions for 'version':\n\n"); + print_windows_versions(); + + return 0; + } + return -1; } diff --git a/programs/winecfg/winecfg.h b/programs/winecfg/winecfg.h index a8d5d5b0ee0..b1325c163c3 100644 --- a/programs/winecfg/winecfg.h +++ b/programs/winecfg/winecfg.h @@ -91,6 +91,7 @@ INT_PTR CALLBACK AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara /* Windows version management */ BOOL set_winver_from_string(const char *version); +void print_windows_versions(void); /* Drive management */ BOOL load_drives(void);