The command line, and what the program and the system it runs on are. More...
#import <Foundation/Foundation.h>


Instance Methods | |
| (id) | - initWithArgc:argv: |
| Initializes an environment for a command line. | |
| (NXMap *) | - parseFlags:error: |
| Parses the flags on the command line. More... | |
| (BOOL) | - writeUsageToStream:flags: |
| Writes a line for each flag to a stream, with its type and its default, such as " --count, -n <int> (default: 3)". More... | |
| (NXArray *) | - arguments |
| Returns the NXString arguments after the flags, from the last parse, or an empty array if there hasn't been one or it failed. | |
| (NXString *) | - name |
| Returns the program's name. | |
| (NXString *) | - version |
| Returns the program's version, or nil. | |
| (NXString *) | - system |
| Returns the system, such as "darwin", "linux" or a Pico board's name. | |
| (NXString *) | - serial |
| Returns the device's serial number, or nil. | |
Instance Methods inherited from NXObject | |
| (void) | - dealloc |
| Frees the instance. More... | |
| (NXZone *) | - zone |
| Returns the zone in which the instance was allocated. More... | |
| (id) | - retain |
| Increases the retain count of the receiver. More... | |
| (void) | - release |
| Decreases the retain count of the receiver. More... | |
| (id) | - autorelease |
| Releases the receiver later, when the current autorelease pool of the thread is drained. More... | |
| (id) | - copy |
| Returns a copy which can't be changed by anything else, which the caller owns and has to release. More... | |
| (uintptr_t) | - hash |
| Returns a number for the object, which is the same for objects which are equal by isEqual:. More... | |
| (NXString *) | - description |
| Returns a string which describes the instance, for logging. More... | |
Instance Methods inherited from Object | |
| (id) | - init |
| Initialize the instance, after allocation. More... | |
| (Class) | - class |
| Returns the class of the instance. More... | |
| (Class) | - superclass |
| Returns the superclass of the instance. More... | |
| (BOOL) | - isEqual: |
| Compares the receiver to another object for equality. More... | |
| (BOOL) | - isKindOfClass: |
| Returns a Boolean value that indicates whether the receiver is an instance of a given class. More... | |
| (BOOL) | - conformsTo: |
| Checks if the receiver's class conforms to a protocol. More... | |
Instance Methods inherited from <ObjectProtocol> | |
| (BOOL) | - respondsToSelector: |
| Checks if the receiver responds to a selector. More... | |
Class Methods | |
| (NXEnvironment *) | + environmentWithArgc:argv: |
| Returns an environment for a command line. More... | |
Class Methods inherited from NXObject | |
| (id) | + alloc |
| Allocates a new instance in the default zone, or if there isn't one, with sys_calloc(). More... | |
| (id) | + allocWithZone: |
| Allocates a new instance in a specific zone. More... | |
| (id) | + new |
| Allocates and initializes a new instance, as [[cls alloc] init] does. More... | |
| (NXString *) | + description |
| Returns the name of the class. | |
Class Methods inherited from Object | |
| (void) | + initialize |
| Performs one-time initialization for the class. More... | |
| (Class) | + class |
| Returns the class object. More... | |
| (Class) | + superclass |
| Returns the superclass of the class. More... | |
| (BOOL) | + conformsTo: |
| Checks if the class conforms to a protocol. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Object | |
| Class | isa |
| A pointer to the object's class structure. More... | |
The command line, and what the program and the system it runs on are.
Flags are parsed with picofuse's parser, as described by NXArgument objects:
picofuse has one parser for the process, so parsing is done one at a time, and everything it returns is copied.
Definition at line 27 of file NXEnvironment.h.
| + (NXEnvironment *) environmentWithArgc: | (int) | argc | |
| argv: | (char **) | argv | |
Returns an environment for a command line.
| argc | The number of arguments, including the program's name. |
| argv | The arguments, which must stay valid while it's used. |
Parses the flags on the command line.
| flags | The NXArgument flags which can be given. |
| error | Set to why it couldn't parse, such as "unknown flag --x", or nil if it doesn't matter. |
Writes a line for each flag to a stream, with its type and its default, such as " --count, -n <int> (default: 3)".
| stream | The stream to write to. |
| flags | The NXArgument flags, as for parseFlags:error:. |