olua.lib.Object└─ olua.app.Application
To run an application, the top-level code needed is:
return [[[YourApplicationSubclassHere alloc] init] runWithArgs: {...}]
| Constructor Summary |
|---|
|
| Method Summary |
|---|
|
| Method Detail |
|---|
addOption: option withHandler: handlerAdds a single argument handler.
addOptions: optionsAdds a table of argument handlers.
addOptions: options withHandler: handlerAdds several arguments with the same handler.
error: e, ...Throws a new instance of olua.app.ApplicationException with the specified
message.
Arguments are formatted with string.format.
initInitialises a new application instance.
Subclasses should override this and call -addOption:withHandler: or
-addOptions: to add command-line option handlers.
nameReturns the name of the application.
This should be overridden to contain the name of the application; it is used in error handling.
parseArguments: argumentsParses an argument list.
remainingArgumentsReturns the unprocessed command line arguments.
reportError: eReports an error to the user and halts.
runAbstract method containing the application logic.
This method is called by -runWithArgs:. The default implementation
does nothing; this should be overridden to contain the application
logic. On error, this method should throw olua.app.ApplicationException.
runWithArgs: argsRuns the application.
The command line arguments are passed (see
olua.app.ArgumentParser>>-parse:), and then
-run is called. If an olua.app.ApplicationException is thrown, it is
reported nicely to the user with -reportError:.