From: Hugh McMaster Subject: uninstaller: Add help switch and usage information (v2) Message-Id: Date: Fri, 21 Aug 2015 16:00:23 +1000 --- programs/uninstaller/main.c | 10 ++++++++-- programs/uninstaller/resource.h | 2 ++ programs/uninstaller/uninstaller.rc | 10 ++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c index a9aae73..6909e0f 100644 --- a/programs/uninstaller/main.c +++ b/programs/uninstaller/main.c @@ -161,6 +161,7 @@ static void RemoveSpecificProgram(WCHAR *nameW) int wmain(int argc, WCHAR *argv[]) { LPCWSTR token = NULL; + static const WCHAR helpW[] = { '-','-','h','e','l','p',0 }; static const WCHAR listW[] = { '-','-','l','i','s','t',0 }; static const WCHAR removeW[] = { '-','-','r','e','m','o','v','e',0 }; int i = 1; @@ -169,8 +170,13 @@ int wmain(int argc, WCHAR *argv[]) { token = argv[i++]; - /* Handle requests just to list the applications */ - if( !lstrcmpW( token, listW ) ) + if( !lstrcmpW( token, helpW ) ) + { + output_message(STRING_HEADER); + output_message(STRING_USAGE); + return 0; + } + else if( !lstrcmpW( token, listW ) ) { ListUninstallPrograms(); return 0; diff --git a/programs/uninstaller/resource.h b/programs/uninstaller/resource.h index f617b2a..72ba160 100644 --- a/programs/uninstaller/resource.h +++ b/programs/uninstaller/resource.h @@ -26,5 +26,7 @@ #define STRING_NO_APP_MATCH 2000 #define STRING_PARAMETER_REQUIRED 2001 #define STRING_INVALID_OPTION 2002 +#define STRING_HEADER 2003 +#define STRING_USAGE 2004 #define MAX_STRING_LEN 255 diff --git a/programs/uninstaller/uninstaller.rc b/programs/uninstaller/uninstaller.rc index e408b91..f742996 100644 --- a/programs/uninstaller/uninstaller.rc +++ b/programs/uninstaller/uninstaller.rc @@ -30,4 +30,14 @@ STRINGTABLE { STRING_NO_APP_MATCH, "uninstaller: The application with GUID '%1' was not found\n" STRING_PARAMETER_REQUIRED, "uninstaller: The option '--remove' must be followed by an application GUID\n" STRING_INVALID_OPTION, "uninstaller: Invalid option [%1]\n" + STRING_HEADER, "Wine Application Uninstaller\n\n\ +\Uninstalls applications from the current Wine prefix.\n\n" + STRING_USAGE, "Usage:\n\ +\ uninstaller [options]\n\n\ +\Options:\n\ +\ --help\t Display this information.\n\ +\ --list\t List all applications installed in this Wine prefix.\n\ +\ --remove {GUID} Uninstall the specified application.\n\ +\t\t Use '--list' to determine the application GUID.\n\ +\ [no option] Launch the graphical version of this program.\n\n" } -- 1.9.1