Add verbose output to "sogo-tool remove" command

This commit is contained in:
Francis Lachapelle committed 2015-09-16 11:39:05 -04:00
1 parent ce11aca2bd
commit 9fd8f3edef
1 file changed
+9 -1
+9 -1
View File
@@ -116,13 +116,19 @@ static NSURL *tableURL = nil;
- (void) _removeUserFolders: (NSString *) userId - (void) _removeUserFolders: (NSString *) userId
{ {
NSArray *folderPaths; NSArray *folderPaths;
NSString *path;
int count, max; int count, max;
folderPaths = [self _userFolderPaths: userId]; folderPaths = [self _userFolderPaths: userId];
max = [folderPaths count]; max = [folderPaths count];
if (max > 0) if (max > 0)
for (count = 0; count < max; count++) for (count = 0; count < max; count++)
[fm deleteFolderAtPath: [folderPaths objectAtIndex: count]]; {
path = [folderPaths objectAtIndex: count];
[fm deleteFolderAtPath: path];
if (verbose)
NSLog (@"Deleting %@", path);
}
else else
NSLog (@"No folder returned for user '%@'", userId); NSLog (@"No folder returned for user '%@'", userId);
} }
@@ -144,6 +150,8 @@ static NSURL *tableURL = nil;
userId]; userId];
if ([fc evaluateExpressionX: sql]) if ([fc evaluateExpressionX: sql])
NSLog (@"Unable to delete the preference record for '%@'", userId); NSLog (@"Unable to delete the preference record for '%@'", userId);
else if (verbose)
NSLog (@"Removed preference record for '%@'", userId);
[cm releaseChannel: fc]; [cm releaseChannel: fc];
} }
} }