From 606325d3b283ae072ca6ebae4c184c16836b5fbb Mon Sep 17 00:00:00 2001 From: Tomaz Kragelj Date: Tue, 15 Sep 2009 11:46:45 +0200 Subject: [PATCH] Updated utility version to 1.0.1 and made it available through a property. --- CommandLineParser.h | 5 ++++- CommandLineParser.m | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CommandLineParser.h b/CommandLineParser.h index 344d6d32..fcb2a36e 100644 --- a/CommandLineParser.h +++ b/CommandLineParser.h @@ -260,11 +260,14 @@ This is used by the log macros, so in most cases, you'll not use it directly in @property(readonly) int verboseLevel; ////////////////////////////////////////////////////////////////////////////////////////// -/// @name Properties - undocumented +/// @name Properties - "undocumented" ////////////////////////////////////////////////////////////////////////////////////////// /** This is used to show or hide the output from the external utilities such as @c doxygen and @c docsetutil. */ @property(readonly) BOOL emitUtilityOutput; +/** The version of appledoc. */ +@property(readonly) NSString* version; + @end diff --git a/CommandLineParser.m b/CommandLineParser.m index 770a69d0..7ecf66f9 100644 --- a/CommandLineParser.m +++ b/CommandLineParser.m @@ -296,8 +296,6 @@ - (void) parseCommandLineArguments:(const char**) argv NSParameterAssert(argv != nil); NSParameterAssert(argc > 0); - logNormal(@"Parsing command line arguments..."); - // Copy the command line arguments to internal array. Note that since the array // will retain all strings, we don't have to retain for each option separately. [commandLineArguments removeAllObjects]; @@ -310,6 +308,8 @@ - (void) parseCommandLineArguments:(const char**) argv // Parse the verbose level first, so that we will correctly log as soon as possible. // Then log the utility command line. [self parseIntegerWithShortcut:@"-v" andName:@"--verbose" forKey:kTKCmdVerboseLevelKey]; + logNormal(@"appledoc v%@", [self version]); + logNormal(@"Parsing command line arguments..."); logVerbose([commandLineArguments objectAtIndex:0]); // Reset the parsing data and read the data from the global templates. This has to @@ -455,7 +455,7 @@ - (void) validateCommandLineArguments - (void) printUsage { printf("USAGE: appledoc [options]\n"); - printf("VERSION: 1.0\n"); + printf("VERSION: %s\n", [[self version] cStringUsingEncoding:NSASCIIStringEncoding]); printf("\n"); printf("OPTIONS - required\n"); printf("-p --project \n"); @@ -1028,4 +1028,10 @@ - (BOOL) emitUtilityOutput return [[parameters objectForKey:kTKCmdEmitUtilityOutputKey] boolValue]; } +//---------------------------------------------------------------------------------------- +- (NSString*) version +{ + return @"1.0.1"; +} + @end