added short cmd line params

git-svn-id: trunk@4823 -
This commit is contained in:
mattias 2003-11-22 15:29:20 +00:00
parent 2d193b48c1
commit aeaf1ae674
11 changed files with 89 additions and 52 deletions

View File

@ -57,7 +57,7 @@ resourcestring
lisIDEOptions = 'IDE Options:'; lisIDEOptions = 'IDE Options:';
lisCmdLineLCLInterfaceSpecificOptions = lisCmdLineLCLInterfaceSpecificOptions =
'LCL Interface specific options:'; 'LCL Interface specific options:';
lisDoNotShowSplashScreen = 'Do not show splash screen'; lisDoNotShowSplashScreen = ' Do not show splash screen';
lissecondaryConfigDirectoryWhereLazarusSearchesFor = lissecondaryConfigDirectoryWhereLazarusSearchesFor =
' secondary config ' ' secondary config '
+'directory, where Lazarus searches for config template files. Default is '; +'directory, where Lazarus searches for config template files. Default is ';

View File

@ -712,10 +712,35 @@ uses
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TMainIDE.ParseCmdLineOptions; procedure TMainIDE.ParseCmdLineOptions;
const const
PrimaryConfPathOpt='--primary-config-path='; PrimaryConfPathOptLong='--primary-config-path=';
SecondaryConfPathOpt='--secondary-config-path='; PrimaryConfPathOptShort='--pcp=';
NoSplashScreenOpt='--no-splash-screen'; SecondaryConfPathOptLong='--secondary-config-path=';
var i: integer; SecondaryConfPathOptShort='--scp=';
NoSplashScreenOptLong='--no-splash-screen';
NoSplashScreenOptShort='--nsc';
function ParamIsOption(ParamIndex: integer;
const Option: string): boolean;
begin
Result:=AnsiCompareText(ParamStr(ParamIndex),Option)=0;
end;
function ParamIsOptionPlusValue(ParamIndex: integer;
const Option: string; var AValue: string): boolean;
var
p: String;
begin
p:=ParamStr(ParamIndex);
Result:=AnsiCompareText(LeftStr(p,length(Option)),Option)=0;
if Result then
AValue:=copy(p,length(Option)+1,length(p))
else
AValue:='';
end;
var
i: integer;
AValue: string;
begin begin
if (ParamCount>0) if (ParamCount>0)
and ((AnsiCompareText(ParamStr(1),'--help')=0) and ((AnsiCompareText(ParamStr(1),'--help')=0)
@ -730,13 +755,20 @@ begin
writeln(''); writeln('');
writeln('--help or -? ', listhisHelpMessage); writeln('--help or -? ', listhisHelpMessage);
writeln(''); writeln('');
writeln(PrimaryConfPathOpt,' <path>'); writeln(PrimaryConfPathOptLong,' <path>');
writeln('or ',PrimaryConfPathOptShort,' <path>');
writeln(BreakString(lisprimaryConfigDirectoryWhereLazarusStoresItsConfig, writeln(BreakString(lisprimaryConfigDirectoryWhereLazarusStoresItsConfig,
75, 22), GetPrimaryConfigPath); 75, 22), GetPrimaryConfigPath);
writeln(SecondaryConfPathOpt,' <path>'); writeln('');
writeln(SecondaryConfPathOptLong,' <path>');
writeln('or ',SecondaryConfPathOptShort,' <path>');
writeln(BreakString(lissecondaryConfigDirectoryWhereLazarusSearchesFor, writeln(BreakString(lissecondaryConfigDirectoryWhereLazarusSearchesFor,
75, 22), GetSecondaryConfigPath); 75, 22), GetSecondaryConfigPath);
writeln(NoSplashScreenOpt,' ',lisDoNotShowSplashScreen); writeln('');
writeln(NoSplashScreenOptLong);
writeln('or ',NoSplashScreenOptShort);
writeln(BreakString(lisDoNotShowSplashScreen,75, 22));
writeln('');
writeln(''); writeln('');
writeln(''); writeln('');
writeln(lisCmdLineLCLInterfaceSpecificOptions); writeln(lisCmdLineLCLInterfaceSpecificOptions);
@ -746,20 +778,22 @@ begin
Halt; Halt;
end; end;
for i:=1 to ParamCount do begin for i:=1 to ParamCount do begin
if AnsiCompareText(LeftStr(ParamStr(i),length(PrimaryConfPathOpt)), if ParamIsOptionPlusValue(i,PrimaryConfPathOptLong,AValue) then begin
PrimaryConfPathOpt)=0 then SetPrimaryConfigPath(AValue);
begin
SetPrimaryConfigPath(copy(ParamStr(i),length(PrimaryConfPathOpt)+1,
length(ParamStr(i))));
end; end;
if AnsiCompareText(LeftStr(ParamStr(i),length(SecondaryConfPathOpt)), if ParamIsOptionPlusValue(i,PrimaryConfPathOptShort,AValue) then begin
SecondaryConfPathOpt)=0 then SetPrimaryConfigPath(AValue);
begin
SetSecondaryConfigPath(copy(ParamStr(i),length(SecondaryConfPathOpt)+1,
length(ParamStr(i))));
end; end;
if AnsiCompareText(ParamStr(i),NoSplashScreenOpt)=0 then if ParamIsOptionPlusValue(i,SecondaryConfPathOptLong,AValue) then begin
SetSecondaryConfigPath(AValue);
end;
if ParamIsOptionPlusValue(i,SecondaryConfPathOptShort,AValue) then begin
SetSecondaryConfigPath(AValue);
end;
if ParamIsOption(i,NoSplashScreenOptLong)
or ParamIsOption(i,NoSplashScreenOptShort) then begin
ShowSplashScreen:=false; ShowSplashScreen:=false;
end;
end; end;
end; end;
@ -10106,6 +10140,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.672 2003/11/22 15:29:20 mattias
added short cmd line params
Revision 1.671 2003/11/22 15:14:12 mattias Revision 1.671 2003/11/22 15:14:12 mattias
prepared IDE units for split prepared IDE units for split

View File

@ -1,3 +1,7 @@
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr "" msgstr ""
@ -1578,10 +1582,6 @@ msgstr "Pantalla(no per win32, p.e. 198.112.45.11:0, x.org:1, hydra:0.1)"
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "Mostrar números de línia en errors en temps d'execució en seguiments inversos" msgstr "Mostrar números de línia en errors en temps d'execució en seguiments inversos"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "No separar la línia després de:" msgstr "No separar la línia després de:"

View File

@ -8,6 +8,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 0.9.6\n" "X-Generator: KBabel 0.9.6\n"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr "" msgstr ""
@ -1588,10 +1592,6 @@ msgstr ""
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "" msgstr ""
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "" msgstr ""

View File

@ -1,3 +1,7 @@
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr "" msgstr ""
@ -1578,10 +1582,6 @@ msgstr "Pantalla (no para win32, e.g. 198.112.45.11:0, x.org:1, hydra:0.1)"
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "Visualizar números de líneas en los errores de tiempo de ejecucion en trazados inversos" msgstr "Visualizar números de líneas en los errores de tiempo de ejecucion en trazados inversos"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "No separar línea después de:" msgstr "No separar línea después de:"

View File

@ -7,6 +7,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 0.9.6\n" "X-Generator: KBabel 0.9.6\n"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr "" msgstr ""
@ -1587,10 +1591,6 @@ msgstr "Affichage (pas pour Win32; par exemple : 198.112.45.11:0, x.org:1, hydra
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "Affiche les numéros de lignes dans les Backtraces d'erreur d'exécution" msgstr "Affiche les numéros de lignes dans les Backtraces d'erreur d'exécution"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr "Ne pas voir l'écran d'acceuil"
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "Pas de ligne de séparation après" msgstr "Pas de ligne de séparation après"

View File

@ -7,6 +7,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr " directory di configurazione primaria, dove Lazarus memorizza i file di configurazione. Il valore predefinito è" msgstr " directory di configurazione primaria, dove Lazarus memorizza i file di configurazione. Il valore predefinito è"
@ -1587,10 +1591,6 @@ msgstr "Display (non per win32, per esempio 198.112.45.11:0, x.org:1, hydra:0.1)
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "Mostra i numeri di linea nelle backtrace degli errori di esecuzione" msgstr "Mostra i numeri di linea nelle backtrace degli errori di esecuzione"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr "Non mostrare schermata di avvio"
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "Non spezzare le righe dietro a:" msgstr "Non spezzare le righe dietro a:"

View File

@ -8,6 +8,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.3\n" "X-Generator: KBabel 1.3\n"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr " g³ówny katalog konfiguracji, gdzie Lazarus przechowuje pliki konfiguracyjne. Domy¶lnie jest to " msgstr " g³ówny katalog konfiguracji, gdzie Lazarus przechowuje pliki konfiguracyjne. Domy¶lnie jest to "
@ -1588,10 +1592,6 @@ msgstr "Ekran (nie dotyczy win32), np. 198.112.45.11:0, x.org:1, hydra:0.1"
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "Wy¶wietlaj numery linii w zrzucie b³êdu uruchomieniowego:" msgstr "Wy¶wietlaj numery linii w zrzucie b³êdu uruchomieniowego:"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr "Nie pokazuj ekranu startowego"
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "Nie dziel wiersza po:" msgstr "Nie dziel wiersza po:"

View File

@ -31,7 +31,7 @@ msgid "LCL Interface specific options:"
msgstr "" msgstr ""
#: lazarusidestrconsts:lisdonotshowsplashscreen #: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen" msgid " Do not show splash screen"
msgstr "" msgstr ""
#: lazarusidestrconsts:lissecondaryconfigdirectorywherelazarussearchesfor #: lazarusidestrconsts:lissecondaryconfigdirectorywherelazarussearchesfor

View File

@ -1,3 +1,7 @@
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr " ÇÌÁ×ÎÙÊ ËÁÔÁÌÏÇ ÎÁÓÔÒÏÅË, ÇÄÅ Lazarus ÈÒÁÎÉÔ Ó×ÏÉ ÆÁÊÌÙ ÎÁÓÔÒÏÅË. ðÏ ÕÍÏÌÞÁÎÉÀ " msgstr " ÇÌÁ×ÎÙÊ ËÁÔÁÌÏÇ ÎÁÓÔÒÏÅË, ÇÄÅ Lazarus ÈÒÁÎÉÔ Ó×ÏÉ ÆÁÊÌÙ ÎÁÓÔÒÏÅË. ðÏ ÕÍÏÌÞÁÎÉÀ "
@ -1578,10 +1582,6 @@ msgstr "
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "÷ÙÄÁÔØ ÎÏÍÅÒÁ ÓÔÒÏË × ÏÛÉÂËÁÈ ×ÒÅÍÅÎÉ ÉÓÐÏÌÎÅÎÉÑ" msgstr "÷ÙÄÁÔØ ÎÏÍÅÒÁ ÓÔÒÏË × ÏÛÉÂËÁÈ ×ÒÅÍÅÎÉ ÉÓÐÏÌÎÅÎÉÑ"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr "Не показывать заставку"
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "îÅ ÒÁÚÒÙ×ÁÔØ ÓÔÒÏËÕ ÐÏÓÌÅ:" msgstr "îÅ ÒÁÚÒÙ×ÁÔØ ÓÔÒÏËÕ ÐÏÓÌÅ:"

View File

@ -1,3 +1,7 @@
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig #: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is " msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr " ãëàâíûé êàòàëîã íàñòðîåê, ãäå Lazarus õðàíèò ñâîè ôàéëû íàñòðîåê. Ïî óìîë÷àíèþ " msgstr " ãëàâíûé êàòàëîã íàñòðîåê, ãäå Lazarus õðàíèò ñâîè ôàéëû íàñòðîåê. Ïî óìîë÷àíèþ "
@ -1578,10 +1582,6 @@ msgstr "
msgid "Display Line Numbers in Run-time Error Backtraces" msgid "Display Line Numbers in Run-time Error Backtraces"
msgstr "Âûäàòü íîìåðà ñòðîê â îøèáêàõ âðåìåíè èñïîëíåíèÿ" msgstr "Âûäàòü íîìåðà ñòðîê â îøèáêàõ âðåìåíè èñïîëíåíèÿ"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr "Не показывать заставку"
#: lazarusidestrconsts:dlgnotsplitlineafter #: lazarusidestrconsts:dlgnotsplitlineafter
msgid "Do not split line after:" msgid "Do not split line after:"
msgstr "Íå ðàçðûâàòü ñòðîêó ïîñëå:" msgstr "Íå ðàçðûâàòü ñòðîêó ïîñëå:"