Index: contrib/MacPorts_Framework/MPInterpreter.h
===================================================================
--- contrib/MacPorts_Framework/MPInterpreter.h	(revision 40301)
+++ contrib/MacPorts_Framework/MPInterpreter.h	(revision 40518)
@@ -98,11 +98,13 @@
 @interface MPInterpreter : NSObject  {
 	
-	Tcl_Interp* _interpreter;
-	NSString * helperToolInterpCommand;
-	NSString * helperToolCommandResult;
+	Tcl_Interp*	_interpreter;
+	NSString *	helperToolInterpCommand;
+	NSString *	helperToolCommandResult;
+	NSArray *	defaultPortOptions;
 	
 }
 
-
+//Internal methods
+-(BOOL) setOptionsForNewTclPort:(NSArray *)options;
 
 /*!
@@ -110,4 +112,6 @@
  */
 + (MPInterpreter *)sharedInterpreter;
+
+
 
 
@@ -116,5 +120,5 @@
  @param path An NSString specifying the absolute path for the macports tcl package
  */
-+ (MPInterpreter *)sharedInterpreterWithPkgPath:(NSString *)path;
++ (MPInterpreter *)sharedInterpreterWithPkgPath:(NSString *)path portOptions:(NSArray *)options;
 
 
@@ -190,5 +194,4 @@
 
 // METHODS FOR INTERNAL USE ONLY
-- (id) initWithPkgPath:(NSString *)path;
 - (Tcl_Interp *) sharedInternalTclInterpreter;
 - (int) execute:(NSString *)pathToExecutable withArgs:(NSArray*)args;
Index: contrib/MacPorts_Framework/MPInterpreter.m
===================================================================
--- contrib/MacPorts_Framework/MPInterpreter.m	(revision 40301)
+++ contrib/MacPorts_Framework/MPInterpreter.m	(revision 40518)
@@ -165,14 +165,10 @@
 static NSString * tclInterpreterPkgPath = nil;
 
-
-- (id) init {
-	return [self initWithPkgPath:MP_DEFAULT_PKG_PATH];
-}
-
-//Internal method for initializing Tcl interpreter
+#pragma mark -
+#pragma mark Internal Methods
+//Internal method for initializing actual C Tcl interpreter
 //Should I be using a double pointer like is done for NSError ?
 -(BOOL) initTclInterpreter:(Tcl_Interp * *)interp withPath:(NSString *)path {
 	BOOL result = NO;
-	
 	*interp = Tcl_CreateInterp();
 	
@@ -187,4 +183,7 @@
 		return result;
 	}
+	
+	if (path == nil)
+		path = MP_DEFAULT_PKG_PATH;
 	
 	
@@ -206,6 +205,6 @@
 	
 	if( Tcl_EvalFile(*interp, [[[NSBundle bundleWithIdentifier:@"org.macports.frameworks.macports"] 
-									 pathForResource:@"init" 
-									 ofType:@"tcl"] UTF8String]) != TCL_OK) {
+								pathForResource:@"init" 
+								ofType:@"tcl"] UTF8String]) != TCL_OK) {
 		NSLog(@"Error in Tcl_EvalFile init.tcl: %s", Tcl_GetStringResult(*interp));
 		Tcl_DeleteInterp(*interp);
@@ -228,6 +227,8 @@
 			
 			while ((opt = [optionsEnum nextObject])) {
-				if (Tcl_Eval(*interp , [[NSString stringWithFormat:@"set ui_options(%@) \"yes\"", opt] UTF8String]) != TCL_OK) 
+				if (Tcl_Eval(*interp , [[NSString stringWithFormat:@"set ui_options(%@) \"yes\"", opt] UTF8String]) != TCL_OK) {
+					NSLog(@"Error in Tcl_Eval for set ui_options: %s", Tcl_GetStringResult(*interp));
 					return result;
+				}
 			}
 			result = YES;
@@ -239,8 +240,34 @@
 }
 
-- (id) initWithPkgPath:(NSString *)path {
+//Wrapper method for above. Used when 
+-(BOOL) setOptionsForNewTclPort:(NSArray *)options {
+	BOOL result = NO;
+	
+	//First delete our internal Tcl interpreter
+	Tcl_DeleteInterp(_interpreter);
+	
+	if (tclInterpreterPkgPath == nil) 
+		result = [self initTclInterpreter:&_interpreter withPath:MP_DEFAULT_PKG_PATH];
+	else 
+		result = [self initTclInterpreter:&_interpreter withPath:tclInterpreterPkgPath];
+	
+	BOOL tempResult = [self setOptions:options forTclInterpreter:&_interpreter];
+		
+	
+	
+	
+	return (result && tempResult) ;
+} 
+
+- (id) initWithPkgPath:(NSString *)path portOptions:(NSArray *)options {
 	if (self = [super init]) {
 		
 		[self initTclInterpreter:&_interpreter withPath:path];
+		
+		//set port options maybe I should do this elsewhere?
+		defaultPortOptions = [NSArray arrayWithObjects: MPDEBUGOPTION, nil];
+		if (options == nil)
+			options = defaultPortOptions;
+		[self setOptions:options forTclInterpreter:&_interpreter];
 		
 		//Initialize helperToolInterpCommand
@@ -256,7 +283,7 @@
 
 
-+ (MPInterpreter*)sharedInterpreter {
-	
-	return [self sharedInterpreterWithPkgPath:MP_DEFAULT_PKG_PATH];
+#pragma mark API methods
+- (id) init {
+	return [self initWithPkgPath:MP_DEFAULT_PKG_PATH portOptions:nil];
 }
 
@@ -264,5 +291,20 @@
 	@synchronized(self) {
 		if ([[[NSThread currentThread] threadDictionary] objectForKey:@"sharedMPInterpreter"] == nil) {
-			[[self alloc] initWithPkgPath:path]; // assignment not done here
+			[[self alloc] initWithPkgPath:path portOptions:nil]; // assignment not done here
+		}
+	}
+	return [[[NSThread currentThread] threadDictionary] objectForKey:@"sharedMPInterpreter"];
+}
+
++ (MPInterpreter*)sharedInterpreter{
+	return [self sharedInterpreterWithPkgPath:MP_DEFAULT_PKG_PATH];
+}
+
+
+
++ (MPInterpreter*)sharedInterpreterWithPkgPath:(NSString *)path portOptions:(NSArray *)options {
+	@synchronized(self) {
+		if ([[[NSThread currentThread] threadDictionary] objectForKey:@"sharedMPInterpreter"] == nil) {
+			[[self alloc] initWithPkgPath:path portOptions:options]; // assignment not done here
 		}
 	}
Index: contrib/MacPorts_Framework/MPMacPorts.h
===================================================================
--- contrib/MacPorts_Framework/MPMacPorts.h	(revision 40301)
+++ contrib/MacPorts_Framework/MPMacPorts.h	(revision 40518)
@@ -82,7 +82,11 @@
 + (MPMacPorts *)sharedInstance;
 
++ (MPMacPorts *)sharedInstanceWithPortOptions:(NSArray *)options;
+
 //Names of messages below are subject to change
 + (MPMacPorts *)sharedInstanceWithPkgPath:(NSString *)path;
-- (id) initWithPkgPath:(NSString *)path;
++ (MPMacPorts *)sharedInstanceWithPkgPath:(NSString *)path portOptions:(NSArray *)options;
+- (id) initWithPkgPath:(NSString *)path portOptions:(NSArray *)options;
+- (BOOL) setPortOptions:(NSArray *)options;
 
 /*!
Index: contrib/MacPorts_Framework/MPMacPorts.m
===================================================================
--- contrib/MacPorts_Framework/MPMacPorts.m	(revision 40301)
+++ contrib/MacPorts_Framework/MPMacPorts.m	(revision 40518)
@@ -42,11 +42,11 @@
 
 - (id) init {
-	return [self initWithPkgPath:MP_DEFAULT_PKG_PATH];
-}
-
-
-- (id) initWithPkgPath:(NSString *)path {
+	return [self initWithPkgPath:MP_DEFAULT_PKG_PATH portOptions:nil];
+}
+
+
+- (id) initWithPkgPath:(NSString *)path portOptions:(NSArray *)options {
 	if (self = [super init]) {
-		interpreter = [MPInterpreter sharedInterpreterWithPkgPath:path];
+		interpreter = [MPInterpreter sharedInterpreterWithPkgPath:path portOptions:nil];
 		//[self registerForLocalNotifications];
 	}
@@ -56,4 +56,17 @@
 + (MPMacPorts *)sharedInstance {
 	return [self sharedInstanceWithPkgPath:MP_DEFAULT_PKG_PATH];
+}
+
++ (MPMacPorts *)sharedInstanceWithPortOptions:(NSArray *)options {
+	return [self sharedInstanceWithPkgPath:MP_DEFAULT_PKG_PATH portOptions:options];
+}
+
++ (MPMacPorts *)sharedInstanceWithPkgPath:(NSString *)path portOptions:(NSArray *)options {
+	@synchronized(self) {
+		if ([[[NSThread currentThread] threadDictionary] objectForKey:@"sharedMPMacPorts"] == nil) {
+			[[self alloc] initWithPkgPath:path portOptions:options ]; // assignment not done here
+		}
+	}
+	return [[[NSThread currentThread] threadDictionary] objectForKey:@"sharedMPMacPorts"];
 }
 
@@ -61,5 +74,5 @@
 	@synchronized(self) {
 		if ([[[NSThread currentThread] threadDictionary] objectForKey:@"sharedMPMacPorts"] == nil) {
-			[[self alloc] initWithPkgPath:path]; // assignment not done here
+			[[self alloc] initWithPkgPath:path portOptions:nil ]; // assignment not done here
 		}
 	}
@@ -67,5 +80,7 @@
 }
 
-
+- (BOOL) setPortOptions:(NSArray *)options {
+	return [interpreter setOptionsForNewTclPort:options];
+}
 
 
Index: contrib/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
===================================================================
--- contrib/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj	(revision 40301)
+++ contrib/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj	(revision 40518)
@@ -88,11 +88,4 @@
 			remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
 			remoteInfo = MacPorts;
-		};
-		6E31A2890E6F7910002804D0 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DFE353650CFB8F0C003BACFC;
-			remoteInfo = Docs;
 		};
 		6EC2608B0E4270110013BC48 /* PBXContainerItemProxy */ = {
@@ -522,5 +515,4 @@
 				6ED12A530E3E55A50026773D /* PBXTargetDependency */,
 				6EC2608C0E4270110013BC48 /* PBXTargetDependency */,
-				6E31A28A0E6F7910002804D0 /* PBXTargetDependency */,
 			);
 			name = MacPorts;
@@ -694,9 +686,4 @@
 			target = 8DC2EF4F0486A6940098B216 /* MacPorts */;
 			targetProxy = 6E1AE8460E232D0700F6D7BC /* PBXContainerItemProxy */;
-		};
-		6E31A28A0E6F7910002804D0 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DFE353650CFB8F0C003BACFC /* Docs */;
-			targetProxy = 6E31A2890E6F7910002804D0 /* PBXContainerItemProxy */;
 		};
 		6EC2608C0E4270110013BC48 /* PBXTargetDependency */ = {
