Permalink
Browse files

Testing command line arguments

  • Loading branch information...
1 parent 6a6a7cc commit fc01eb25b60bd625bdd298fd27db95f755831df0 @tomas tomas committed Oct 19, 2009
Showing with 12 additions and 2 deletions.
  1. +12 −2 distribution/windows/cron.ahk
@@ -7,10 +7,20 @@
#SingleInstance force
PreyPath = c:\Prey
MinDelay = 120000 ; two minutes
-ExecutionDelay = 1200000 ; twenty minutes
+ExecutionDelay = 1200000 ; twenty minutes
+Log_to = ;
+Test = ;
+
+Loop, %0% { ; for each command line parameter
+ If (%A_Index% = "--log")
+ Log_to = "> %PreyPath%/prey.log"
+ Else If (%A_Index% = "--test")
+ Test = -t ;
+}
+
Loop
{
- RunWait, %comspec% /c %PreyPath%\bin\bash.exe %PreyPath%\prey.sh > %PreyPath%/prey.log, %PreyPath%, hide
+ RunWait, %comspec% /c %PreyPath%\bin\bash.exe %PreyPath%\prey.sh %Test% %Log_to%, %PreyPath%, hide
FileRead, Contents, %PreyPath%\delay
if (not ErrorLevel and Contents > MinDelay)
{

0 comments on commit fc01eb2

Please sign in to comment.