From e6859b987a79b03e776bd55f1d4c819661c3564f Mon Sep 17 00:00:00 2001 From: vincents Date: Wed, 9 Jul 2008 14:59:04 +0000 Subject: [PATCH] IDE: small improvements to the command line handling git-svn-id: trunk@15724 - --- ide/idecmdline.pas | 8 ++++---- ide/main.pp | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ide/idecmdline.pas b/ide/idecmdline.pas index fefdc9e4f5..09f7d2e4eb 100644 --- a/ide/idecmdline.pas +++ b/ide/idecmdline.pas @@ -124,10 +124,10 @@ end; function IsHelpRequested (index : Integer = 1) : Boolean; begin - Result := (ParamCount>0) and - ((CompareText (ParamStr(index), '--help') = 0) or - (CompareText (ParamStr(index), '-help') = 0) or - (CompareText (ParamStr(index), '-?') = 0) or + Result := (ParamCount>=index) and + ((CompareText (ParamStr(index), '--help') = 0) or + (CompareText (ParamStr(index), '-help') = 0) or + (CompareText (ParamStr(index), '-?') = 0) or (CompareText (ParamStr(index), '-h') = 0)); end; diff --git a/ide/main.pp b/ide/main.pp index 1c51c174c8..177d939dd4 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -9435,17 +9435,16 @@ procedure TMainIDE.DoRestart; exit; end; //DebugLn('Setting CommandLine'); - StartLazProcess.CommandLine := ExeName + - ' --lazarus-pid='+IntToStr(GetProcessID) + - ' ' + + StartLazProcess.CommandLine := ExeName + + ' --lazarus-pid='+IntToStr(GetProcessID) + ' ' + GetCommandLineParameters(Params, False); //DebugLn('CommandLine 1 : %s', [StartLazProcess.CommandLine]); if (pos(PrimaryConfPathOptLong, StartLazProcess.CommandLine) = 0) and - (pos(PrimaryConfPathOptShort, StartLazProcess.CommandLine) = 0) then + (pos(PrimaryConfPathOptShort, StartLazProcess.CommandLine) = 0) then StartLazProcess.CommandLine := StartLazProcess.CommandLine + - ' ' + PrimaryConfPathOptLong + '="'+GetPrimaryConfigPath+'"'; + ' "' + PrimaryConfPathOptLong + '='+GetPrimaryConfigPath+'"'; //DebugLn('CommandLine 2 : %s', [StartLazProcess.CommandLine]);