Browse Source

fcl-hash: fixed start without params, show config filename

mattias 2 years ago
parent
commit
93816c379b

+ 2 - 1
packages/fcl-hash/examples/.gitignore

@@ -1,2 +1,3 @@
 authenticator
-gentotp
+gentotp
+lib

+ 9 - 1
packages/fcl-hash/examples/authenticator.lpi

@@ -7,7 +7,6 @@
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
         <MainUnitHasScaledStatement Value="False"/>
-        <UseDefaultCompilerOptions Value="True"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <Title Value="authenticator"/>
@@ -37,8 +36,17 @@
       <Filename Value="authenticator"/>
     </Target>
     <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
       <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
+    <Linking>
+      <Debugging>
+        <DebugInfoType Value="dsDwarf3"/>
+      </Debugging>
+    </Linking>
+    <Other>
+      <CompilerPath Value="/usr/lib/fpc/3.3.1/ppcx64"/>
+    </Other>
   </CompilerOptions>
   <Debugging>
     <Exceptions>

+ 5 - 1
packages/fcl-hash/examples/authenticator.pp

@@ -65,6 +65,7 @@ begin
   Writeln('-g --generate  Generate and print new key');
   Writeln('-l --list      List known keys');
   Writeln('-c --check     Check code against key for given name');
+  Writeln('config file: ',GetAppConfigFile(False));
   ExitCode:=Ord(AError<>'')
 end;
 
@@ -194,7 +195,10 @@ begin
       end;
     mPrint:
       begin
-      PrintKey(NonArgs[0]);
+      if length(NonArgs)>0 then
+        PrintKey(NonArgs[0])
+      else
+        Usage('');
       end;
     mGenerate:
       Writeln(TOTPSharedSecret());