// // BMScript.h // BMScriptTest // // Created by Andre Berg on 11.09.09. // Copyright 2009 Berg Media. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // MARK: Docs: Mainpage /*! * @mainpage BMScript: Harness The Power Of Shell Scripts *
* @par Introduction * * BMScript is an Objective-C class set to make it easier to utilize the * power and flexibility of a whole range of scripting languages that already * come with modern Macs. BMScript does not favor any particular scripting * language or UNIX™ command line tool for that matter, instead it was written * as an abstraction layer to NSTask, and as such supports any command line tool, * provided that it is available on the target system. * * @par Usage * * BMScript can be used in two ways: * * -# Use it directly * -# Guided by the BMScriptLanguageProtocol, make a subclass from it * * The easiest way to use BMScript is, of course, to instanciate it directly: * * @include bmScriptCreationMethods.m * * You typically use the designated initializer for which you supply the script * source and script options yourself.
* The options dictionary then looks like this: * * @include bmScriptOptionsDictionary.m * * There's two constant keys. These are the only keys you need to define values for. * #BMScriptOptionsTaskLaunchPathKey stores the path to the tool's executable and * #BMScriptOptionsTaskArgumentsKey is a nil-terminated variable list of parameters * to be used as arguments to the task which will load and execute the tool found at * the launch path specified for the other key. * * It is very important to note that the script source string should NOT be * supplied in the array for the #BMScriptOptionsTaskArgumentsKey, as it will be added * later by the class after performing tests and delegation which could alter the script * in ways needed to safely execute it. This is in the delegate object's responsibility. * * A macro function called #BMSynthesizeOptions(path, args) is available to ease * the declaration of the options.
* Here is the definition: * * @include bmScriptSynthesizeOptions.m * *
*
*
*
Important:
*
* Don't forget the nil at the end even * if you don't need to supply any task arguments. *
*
*
*
* * If you initialize BMScript directly without specifying options and script source * (e.g. using [[%BMScript alloc] init]) the options * will default to BMSynthesizeOptions(@"/bin/echo", @"") * and the script source will default to @"'