From a02f8fb3d44b8273740d5b6ef482bdc469ebdf2e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 19 Dec 2016 10:13:25 +0100 Subject: Initial commit --- .gitignore | 7 ++++++ analyzer.lpi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ analyzer.lpr | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ analyzer.lps | 17 ++++++++++++++ 4 files changed, 163 insertions(+) create mode 100644 .gitignore create mode 100644 analyzer.lpi create mode 100644 analyzer.lpr create mode 100644 analyzer.lps diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f995854 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.bak +*.ppu +*.o +*.tar.gz +*~ +analyzer +lib diff --git a/analyzer.lpi b/analyzer.lpi new file mode 100644 index 0000000..f5eae51 --- /dev/null +++ b/analyzer.lpi @@ -0,0 +1,62 @@ + + + + + + + + + + + + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <Units Count="1"> + <Unit0> + <Filename Value="analyzer.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <Target> + <Filename Value="analyzer"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/analyzer.lpr b/analyzer.lpr new file mode 100644 index 0000000..02dfd2a --- /dev/null +++ b/analyzer.lpr @@ -0,0 +1,77 @@ +program analyzer; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, CustApp + { you can add units after this }; + +type + + { TAnalyzer } + + TAnalyzer = class(TCustomApplication) + protected + procedure DoRun; override; + public + constructor Create(TheOwner: TComponent); override; + destructor Destroy; override; + procedure WriteHelp; virtual; + end; + +{ TAnalyzer } + +procedure TAnalyzer.DoRun; +var + ErrorMsg: String; +begin + // quick check parameters + ErrorMsg:=CheckOptions('h', 'help'); + if ErrorMsg<>'' then begin + ShowException(Exception.Create(ErrorMsg)); + Terminate; + Exit; + end; + + // parse parameters + if HasOption('h', 'help') then begin + WriteHelp; + Terminate; + Exit; + end; + + { add your program here } + + // stop program loop + Terminate; +end; + +constructor TAnalyzer.Create(TheOwner: TComponent); +begin + inherited Create(TheOwner); + StopOnException:=True; +end; + +destructor TAnalyzer.Destroy; +begin + inherited Destroy; +end; + +procedure TAnalyzer.WriteHelp; +begin + { add your help code here } + writeln('Usage: ', ExeName, ' -h'); +end; + +var + Application: TAnalyzer; +begin + Application:=TAnalyzer.Create(nil); + Application.Title:='Analyzer'; + Application.Run; + Application.Free; +end. + diff --git a/analyzer.lps b/analyzer.lps new file mode 100644 index 0000000..be061c4 --- /dev/null +++ b/analyzer.lps @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectSession> + <Version Value="9"/> + <BuildModes Active="Default"/> + <Units Count="1"> + <Unit0> + <Filename Value="analyzer.lpr"/> + <IsPartOfProject Value="True"/> + <IsVisibleTab Value="True"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + </Unit0> + </Units> + <JumpHistory HistoryIndex="-1"/> + </ProjectSession> +</CONFIG> -- cgit v1.2.3-54-g00ecf