I am not sure if this is what was meant, but here goes.
Note: Assumes "Cat in hat" passed as argument on command line.
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import <Foundation/NSProcessInfo.h>
#import <Foundation/NSDictionary.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSProcessInfo *proc = [NSProcessInfo processInfo];
int x;
NSDictionary *env = [proc environment];
NSLog(@"Usage: \"activeProcessorCount.\" Number of Active Processors: %u", [proc activeProcessorCount]);
NSLog(@"Usage: \"arguments\". Assumed \"Cat in hat\" in command line");
NSLog(@"Usage: \"[arguments count]\" %u", [[proc arguments]count]);
NSArray *args = [proc arguments];
NSLog(@"Iterate through NSArray \"arguments\"");
for ( x = 1; x < args.count; x ++)
NSLog(@"%@", [args objectAtIndex: x] );
NSLog(@"Iterate through environment");
for (id key in env)
{
NSLog(@"key: %@, value: %@", key, [env objectForKey:key]);
}
NSLog(@"Usage:\"globally Unique String\": %@", [proc globallyUniqueString]);
NSLog(@"Usage:\"host name\": %@", [proc hostName]);
NSLog(@"Usage:\"operating system\": %u", [proc operatingSystem]);
NSLog(@"Usage:\"operating system name\": %@", [proc operatingSystemName]);
NSLog(@"Usage:\"operating system version string\": %@", [proc operatingSystemVersionString]);
NSLog(@"Usage:\"physical memory\": %llu", [proc physicalMemory]);
NSLog(@"Usage:\"processIdentifier\": %u", [proc processIdentifier]);
NSLog(@"Usage:\"process name\": %@", [proc processName]);
NSLog(@"Usage: \"ProcessorCount.\" Number of Processors: %u", [proc processorCount]);
[pool drain];
return 0;
}