From 9f7a93a620aad0f87f5edc583aed7871998284e1 Mon Sep 17 00:00:00 2001 From: Karlson2k Date: Sat, 16 Jul 2016 19:20:44 +0300 Subject: [PATCH] msys2_shell.cmd: print help if asked by '--help', '-?' or '/?' parameters This simplify usage for people who are used to the MS or GNU standards. --- filesystem/msys2_shell.cmd | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/filesystem/msys2_shell.cmd b/filesystem/msys2_shell.cmd index 2c870a24..287f0f16 100644 --- a/filesystem/msys2_shell.cmd +++ b/filesystem/msys2_shell.cmd @@ -20,6 +20,18 @@ if "x%~1" == "x-help" ( call :printhelp "%~nx0" exit /b %ERRORLEVEL% ) +if "x%~1" == "x--help" ( + call :printhelp "%~nx0" + exit /b %ERRORLEVEL% +) +if "x%~1" == "x-?" ( + call :printhelp "%~nx0" + exit /b %ERRORLEVEL% +) +if "x%~1" == "x/?" ( + call :printhelp "%~nx0" + exit /b %ERRORLEVEL% +) rem Shell types if "x%~1" == "x-msys" shift& set MSYSTEM=MSYS& goto :checkparams if "x%~1" == "x-msys2" shift& set MSYSTEM=MSYS& goto :checkparams @@ -132,6 +144,7 @@ echo Set terminal type echo -here [DIRECTORY] Starting directory echo -[use-]full-path Use full currnent PATH variable echo instead of triming to minimal +echo -help ^| --help ^| -? ^| /? Display this help and exit echo. echo Any parameter that cannot be treated as valid option and all echo following parameters are passed as bash command parameters.