diff --git a/macbrush/macbrush.xcodeproj/project.pbxproj b/macbrush/macbrush.xcodeproj/project.pbxproj index 717d990..bbe7136 100644 --- a/macbrush/macbrush.xcodeproj/project.pbxproj +++ b/macbrush/macbrush.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 2912BF7C1B2084FB00FAC05E /* macbrush.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; name = macbrush.1; path = macbrush/macbrush.1; sourceTree = ""; }; 294BF1931B1A13CD00506C50 /* macbrush */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = macbrush; sourceTree = BUILT_PRODUCTS_DIR; }; 294BF1961B1A13CD00506C50 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 294BF19E1B1A141800506C50 /* GBCli.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GBCli.h; sourceTree = ""; }; @@ -39,7 +40,6 @@ 294BF1A51B1A141800506C50 /* GBSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GBSettings.h; sourceTree = ""; }; 294BF1A61B1A141800506C50 /* GBSettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GBSettings.m; sourceTree = ""; }; 294BF1A71B1A141800506C50 /* main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = main.h; sourceTree = ""; }; - 29D42FF31B1A26E6003C4D11 /* macbrush.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = macbrush.rb; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,6 +56,7 @@ 294BF18A1B1A13CD00506C50 = { isa = PBXGroup; children = ( + 2912BF7C1B2084FB00FAC05E /* macbrush.1 */, 294BF1951B1A13CD00506C50 /* macbrush */, 294BF1941B1A13CD00506C50 /* Products */, ); @@ -72,7 +73,6 @@ 294BF1951B1A13CD00506C50 /* macbrush */ = { isa = PBXGroup; children = ( - 29D42FF31B1A26E6003C4D11 /* macbrush.rb */, 294BF19E1B1A141800506C50 /* GBCli.h */, 294BF19F1B1A141800506C50 /* GBCommandLineParser.h */, 294BF1A01B1A141800506C50 /* GBCommandLineParser.m */, diff --git a/macbrush/macbrush/macbrush.1 b/macbrush/macbrush/macbrush.1 index 1716df5..9eb84c0 100644 --- a/macbrush/macbrush/macbrush.1 +++ b/macbrush/macbrush/macbrush.1 @@ -1,18 +1,29 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.5. -.TH MACBRUSH, "1" "Juni 2015" "macbrush, Version 0.6" "User Commands" +.TH MACBRUSH, "1" "Juni 2015" "macbrush, Version 0.7" "User Commands" .SH NAME -macbrush, \- manual page for macbrush, Version 0.6 +macbrush, \- Keep OS X folders clean of temporary files .SH DESCRIPTION usage: macbrush [\-d] [\-a] [\-o] [\-i] [\-s] [\-v] [\-c] [\-o] [\-h] targetDirectory -.SH "SEE ALSO" -The full documentation for -.B macbrush, -is maintained as a Texinfo manual. If the -.B info -and -.B macbrush, -programs are properly installed at your site, the command -.IP -.B info macbrush, -.PP -should give you access to the complete manual. +.SH OPTIONS +.TP +.BR \-d ", " \-\-ignore\-dot\underscore +Do not remove ._ files. +.BR \-a ", " \-\-ignore\-apdisk +Do not remove .apdisk\-files. +.BR \-s ", " \-\-ignore\-dsstore +Do not remove .DS_Store\-files. +.BR \-i ", " \-\-ignore\-volumeicon +Do not remove .VolumeIcon.icnds\-files. +.BR \-s ", " \-\-silmulate +Do not remove any files. Simulation only. Pleaes use in combination with \-\-verbose. +.BR \-V ", " \-\-verbose +Verbose logging. +.BR \-c ", " \-\-skip\-clean +Do not clean folders. Directly enter observation mode. +.BR \-o ", " \-\-skip\-observation +Do not enter observation mode. Only clean folders once. +.BR \-h ", " \-\-help +Print help message. +.BR \-v ", " \-\-version +Print version information. +.SH AUTHOR +Nils Tekampe \ No newline at end of file diff --git a/macbrush/macbrush/main.h b/macbrush/macbrush/main.h index 77803df..c07c29f 100644 --- a/macbrush/macbrush/main.h +++ b/macbrush/macbrush/main.h @@ -13,6 +13,8 @@ #endif #define USAGE @"usage: macbrush [-d] [-a] [-o] [-i] [-s] [-v] [-c] [-o] [-h] targetDirectory" +#define VERSION @"macbrush, Version 0.7" +#define INFO @"macbrush - Keep OS X folders clean of temporary files" void logger(NSString *message, bool verbose_only); void mycallback( diff --git a/macbrush/macbrush/main.m b/macbrush/macbrush/main.m index 14016f2..dc63825 100644 --- a/macbrush/macbrush/main.m +++ b/macbrush/macbrush/main.m @@ -52,16 +52,17 @@ int main(int argc, const char * argv[]) { // Create parser and register all options. GBCommandLineParser *parser = [[GBCommandLineParser alloc] init]; + [parser registerOption:@"help" shortcut:'h' requirement:GBValueNone]; + [parser registerOption:@"version" shortcut:'v' requirement:GBValueNone]; [parser registerOption:@"ignore-dot-underscore" shortcut:'d' requirement:GBValueNone]; [parser registerOption:@"ignore-apdisk" shortcut:'a' requirement:GBValueNone]; - [parser registerOption:@"ignore-dsstore" shortcut:'o' requirement:GBValueNone]; + [parser registerOption:@"ignore-dsstore" shortcut:'s' requirement:GBValueNone]; [parser registerOption:@"ignore-volumeicon" shortcut:'i' requirement:GBValueNone]; [parser registerOption:@"simulate" shortcut:'s' requirement:GBValueNone]; - [parser registerOption:@"verbose" shortcut:'v' requirement:GBValueNone]; + [parser registerOption:@"verbose" shortcut:'V' requirement:GBValueNone]; [parser registerOption:@"skip-clean" shortcut:'c' requirement:GBValueNone]; [parser registerOption:@"skip-observation" shortcut:'o' requirement:GBValueNone]; - [parser registerOption:@"help" shortcut:'h' requirement:GBValueNone]; - [parser registerOption:@"version" shortcut:0 requirement:GBValueNone]; + // Register settings and then parse command line [parser registerSettings:settings]; @@ -83,14 +84,13 @@ int main(int argc, const char * argv[]) { //*********************************************** if ([settings boolForKey:@"help"]){ - + logger(INFO, false); logger(USAGE, false); return 0; } if ([settings boolForKey:@"version"]){ - - logger(@"macbrush, Version 0.6", false); + logger(VERSION, false); return 0; } @@ -407,10 +407,8 @@ void cleanDirectory(NSString *directory) filename= [directory stringByAppendingPathComponent:file]; processFile(filename); } - - logger([NSString stringWithFormat:@"%@%@", @"Finished cleaning directory :" , directory],false); logger([NSString stringWithFormat:@"%d%@",sumDotAPDisk, @" .AP_Disk files have been removed"],false); logger([NSString stringWithFormat:@"%d%@",sumDotUnderscore, @" ._ files have been removed"],false); diff --git a/macbrush/manpage b/macbrush/manpage deleted file mode 100644 index e69de29..0000000