Index: trunk/launch/launch/README
===================================================================
--- trunk/launch/launch/README	(revision 215)
+++ trunk/launch/launch/README	(revision 265)
@@ -1,3 +1,3 @@
-launch 1.0.1 [3 April 2005]
+launch 1.1d2 [unreleased]
 ============
 
@@ -63,5 +63,5 @@
 An Xcode project, 'launch.xcodeproj', is included.  A precompiled Universal
 binary is also provided.  'launch' was developed and tested under Mac OS X 
-10.4.5 with Xcode 2.2.1, and does not require any additional software to
+10.4.7 with Xcode 2.3, and does not require any additional software to
 build.
 
@@ -223,7 +223,10 @@
 
 1.1 - unreleased
+ - -L: send "launch" (ascr/noop) event to app, bypasses automatic
  - -o: pass command-line arguments (broken, r. 4474993)
+   opening of untitled document, etc.
  - display content type ID (UTI)    
  - switched to new LSOpen APIs (now requires Mac OS X 10.4 or later)
+ - switched to new date formatting APIs (the old ones are deprecated)
  - for compatibility with open(1), take app path as argument to -a
 1.0.1 - 3 April 2005
Index: trunk/launch/launch/VERSION
===================================================================
--- trunk/launch/launch/VERSION	(revision 215)
+++ trunk/launch/launch/VERSION	(revision 265)
@@ -1,1 +1,1 @@
-1.1d1
+1.1d2
Index: trunk/launch/launch/launch.xcodeproj/project.pbxproj
===================================================================
--- trunk/launch/launch/launch.xcodeproj/project.pbxproj	(revision 215)
+++ trunk/launch/launch/launch.xcodeproj/project.pbxproj	(revision 265)
@@ -206,5 +206,5 @@
 					i386,
 				);
-				MACOSX_DEPLOYMENT_TARGET = 10.2;
+				MACOSX_DEPLOYMENT_TARGET = 10.4;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 			};
@@ -218,5 +218,5 @@
 					i386,
 				);
-				MACOSX_DEPLOYMENT_TARGET = 10.2;
+				MACOSX_DEPLOYMENT_TARGET = 10.4;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 			};
@@ -230,5 +230,5 @@
 					i386,
 				);
-				MACOSX_DEPLOYMENT_TARGET = 10.2;
+				MACOSX_DEPLOYMENT_TARGET = 10.4;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 			};
Index: trunk/launch/launch/main.c
===================================================================
--- trunk/launch/launch/main.c	(revision 215)
+++ trunk/launch/launch/main.c	(revision 265)
@@ -33,5 +33,5 @@
 const char *APP_NAME;
 
-#define VERSION "1.1d1"
+#define VERSION "1.1d2"
 
 #define STRBUF_LEN 1024
@@ -92,6 +92,6 @@
 
 void usage() {
-    fprintf(stderr, "usage: %s [-npswbmhCXU] [-c creator] [-i bundleID] [-u URL] [-a name] [-o argument] [item ...] [-]\n"
-                    "   or: %s [-npflswbmhCXU] [-o argument] item ...\n", APP_NAME, APP_NAME);
+    fprintf(stderr, "usage: %s [-npswbmhCXLU] [-c creator] [-i bundleID] [-u URL] [-a name] [-o argument] [item ...] [-]\n"
+                    "   or: %s [-npflswbmhCXLU] [-o argument] item ...\n", APP_NAME, APP_NAME);
     fprintf(stderr,
         "  -n            print matching paths/URLs instead of opening them\n"
@@ -108,4 +108,5 @@
         "  -C            force CFM/PEF Carbon application to launch in Classic\n"
         "  -X            don't start Classic for this app if Classic isn't running\n"
+	"  -L            suppress normal opening behavior (e.g. untitled window)\n"
 	"  -U            interpret items as URLs, even if same-named files exist\n"
         "  -c creator    match application by four-character creator code ('ToyS')\n"
@@ -331,5 +332,5 @@
     if (argc == 1) usage();
     
-    while ( (ch = getopt(argc, argv, "npflswbmhCXUc:i:u:a:o:")) != -1) {
+    while ( (ch = getopt(argc, argv, "npflswbmhCXLUc:i:u:a:o:")) != -1) {
         switch (ch) {
         case 'n':
@@ -374,4 +375,11 @@
         case 'C': LPARAMS.flags |= kLSLaunchInClassic; break;  // force Classic
         case 'X': LPARAMS.flags ^= kLSLaunchStartClassic; break;// don't start Classic for app
+	case 'L':
+	{
+	    OSStatus err;
+	    LPARAMS.initialEvent = malloc(sizeof(AppleEvent));
+	    err = AECreateAppleEvent(kASAppleScriptSuite, kASLaunchEvent, NULL, kAutoGenerateReturnID, kAnyTransactionID, LPARAMS.initialEvent);
+	    if (err != noErr) osstatusexit(err, "unable to construct launch Apple Event", argv[0]);
+	}
 	case 'U': OPTS.forceURLs = true; break;
         case 'c':
@@ -531,24 +539,23 @@
 
 void printDateTime(const char *label, UTCDateTime *utcTime, const char *postLabel, Boolean printIfEmpty) {
-    static Str255 dateStr, timeStr;
-    LocalDateTime localTime;
-    LongDateTime longTime;
+    static CFDateFormatterRef formatter = NULL;
+    static char strBuffer[STRBUF_LEN];
+    if (formatter == NULL) {
+	formatter = CFDateFormatterCreate(NULL, CFLocaleCopyCurrent(), kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle);
+    }
+    CFAbsoluteTime absoluteTime;
     OSStatus err;
 
-    err = ConvertUTCToLocalDateTime(utcTime, &localTime);
+    err = UCConvertUTCDateTimeToCFAbsoluteTime(utcTime, &absoluteTime);
     if (err == kUTCUnderflowErr) {
         if (printIfEmpty) printf("\t%s: (not set)\n", label);
         return;
     }
-    if (err != noErr) osstatusexit(err, "unable to convert UTC %s date to local", label);
-
-    longTime = localTime.highSeconds;
-    longTime <<= 32;
-    longTime |= localTime.lowSeconds;
-
-    // strings include trailing newlines; strip them.
-    LongDateString(&longTime, shortDate, dateStr, nil); dateStr[dateStr[0] + 1] = '\0';
-    LongTimeString(&longTime, true, timeStr, nil); timeStr[timeStr[0] + 1] = '\0';
-    printf("\t%s: %s %s%s\n", label, dateStr + 1, timeStr + 1, postLabel);
+    if (err != noErr) osstatusexit(err, "unable to convert UTC %s time", label);
+
+    CFStringRef dateTimeString = CFDateFormatterCreateStringWithAbsoluteTime(NULL, formatter, absoluteTime);
+    CFStringGetCString(dateTimeString, strBuffer, STRBUF_LEN, kCFStringEncodingUTF8);
+    
+    printf("\t%s: %s%s\n", label, strBuffer, postLabel);
 }
 
