-
Notifications
You must be signed in to change notification settings - Fork 0
/
globalunit.pas
executable file
·72 lines (63 loc) · 1.26 KB
/
globalunit.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
unit globalunit;
{$mode objfpc}{$H+}
interface
uses
IniFiles;
const
VERSION = '$VER: MoGit 0.1 (27.02.2018)';
type
TStartModus = (smLog, smCheck);
var
StartModus: TStartModus = smLog;
SrcPath: string = '';
ShowUntracked: Boolean = True;
GitPrg: string = 'System:Development/GG/usr/bin/git';
Editor: string = 'sys:Applications/Scribble/Scribble';
implementation
uses
GitUnit;
procedure ParseParameter;
var
i: Integer;
begin
if ParamCount > 0 then
begin
i := 1;
writeln('Paramstr(1) ', ParamStr(1));
if ParamStr(1) = 'log' then
begin
StartModus := smLog;
i := 2;
end
else
if ParamStr(1) = 'check' then
begin
StartModus := smCheck;
i := 2;
end;
if ParamCount >= i then
begin
SrcPath := ParamStr(i);
end;
SrcPath := GitTopLevel(SrcPath);
end;
end;
procedure LoadSettings;
var
Ini: TIniFile;
begin
Ini := nil;
try
Ini := TIniFile.Create(ParamStr(0) + '.ini');
GitPrg := Ini.ReadString('General', 'Git', GitPrg);
GitPath := GitPrg;
Editor := Ini.ReadString('General', 'DiffEditor', Editor);
ShowUntracked := Ini.ReadBool('General', 'ShowUntracked', True);
except
end;
Ini.Free;
end;
initialization
LoadSettings;
ParseParameter;
end.