Revision [1147]

This is an old revision of CommandRequire made by DavidLee on 2010-02-05 12:56:57.

 

Command require


Name

require Checks the current shell for a specified minimum version


Synopsis

require
require version

Checks to see if the supplied version is less then or equal the the current version of xmlsh. (see xversion).
If the required version is greater then the current version then throws an exception equivalent to the exit on error flag.
require can be trapped with try/catch or with a conditional same as errors from exit on error.

If no arguments are given then require simply is an invalid command for versions prior to the implementation or require (1.0.1).


Examples


Example require version 1.0.2
require 1.0.1 



Check for version 1.0.2 and print an error message but keep going
require 1.0.2 || echo Required verison 1.0.2 ignored


Trap a require or a script calling require with try/catch

try {
   require 99
} catch {
  echo Ignored failure of require 99
}





Commands
CategoryCommands
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki