Команды SFK


    1        2        3        4        5        6        7        8        9        10    

Раздел 7. Scripting - Скрипты
alias | batch | call | cd | clock | color | echo | for | getcwd | label | loop | mkcd | pause | require | setvar | sleep | stop | storetext | tee | time | tofile | toterm |

Help:   Рус   |   Eng        

Команда: require
sfk require inputVersion requiredVersion
sfk require -own requiredVersion

   check a version text against a required version,
   or check SFK's version itself.

   produces shell return code 0 if input version
   is greater or equal to required version.

   options
      -name=x   if input version is too old, SFK prints
                an error message containing x.
      -own      check SFK's own version.
      -quiet    do not print info message
                in case of failure.
      -nostop   do not stop command chaining,
                set rc 5 if requirement fails

   windows .bat file example
      @echo off
      sfk require -own 1.6.1.2
      IF %ERRORLEVEL%==0 GOTO sfkok
      echo "wrong SFK version, stopping."
      exit /B
      :sfkok

   linux bash example
      sfk require -own 1.6.1.2
      iReturnCode=$?
      if [ ! $iReturnCode -eq 0 ]; then
         echo "wrong SFK version, stopping."
         exit
      fi

   further examples
      sfk ver -number dview.exe +require -name=dview 1.4.8
         check if dview.exe is 1.4.8.0 or higher.