From 3b4266d5ae23648c6e965b1676a9012806a18996 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 8 Sep 2011 19:10:41 -0400 Subject: [PATCH] Optional argument to automatically submit and terminate when launching. --- Classes/CNSApp.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/CNSApp.m b/Classes/CNSApp.m index 5f7c891..9d14c35 100644 --- a/Classes/CNSApp.m +++ b/Classes/CNSApp.m @@ -73,6 +73,10 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)aController { self.bundleVersionLabel.stringValue = (self.bundleVersion ?: @"invalid"); self.statusLabel.stringValue = @""; [self.window setTitle:[self.fileURL lastPathComponent]]; + + if ([[[NSProcessInfo processInfo] arguments] containsObject:@"autoSubmit"]) { + [self uploadButtonWasClicked:nil]; + } } #pragma mark - NSDocument Methods @@ -273,6 +277,10 @@ - (void)parseVersionResponse:(CNSConnectionHelper *)aConnectionHelper { [NSApp endSheet:self.uploadSheet]; [self.window performClose:self]; [self close]; + + if ([[[NSProcessInfo processInfo] arguments] containsObject:@"autoSubmit"]) { + [NSApp terminate:nil]; + } }); }