This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Setup patch: List command line options on stdout


cgf said:
>On Wed, Nov 17, 2004 at 08:53:41PM +0100, Reini Urban wrote:
>>Christopher Faylor schrieb:
>>>On Wed, Nov 17, 2004 at 10:10:58AM +0100, Reini Urban wrote:
>>>
>>>Actually, there was a thread about this on the cygwin list not too long 
>>>ago.
>>
>>Yep. This suggested a complicated trick. I found an easier one.
>>I just detect if the console title ends with "setup.exe" 
>>(case-insensitive). If so it's new and can be hidden.
>>
>>>Applications linked with -mwindows (i.e., GUI apps) can't print to
>>>stdout.  How does this actually work, in that case?  Is this expecting
>>>to display something on the console?
>>

I expect to see output and do. Have I something wrong... OK, I hadn't configured
the build right... Nope, reconfigured, rebuilt and still see the output. I don't
get it

>>I added a patch to switch to the console subsystem and hide this concole 
>>if it was a fresh new console. Otherwise, if called from a console or if 
>>called with -h leave the console.
>>
>>Patch see http://sourceware.org/bugzilla/show_bug.cgi?id=556
>
>I really don't understand why we should stand on our heads to make
>setup.exe a console subsystem program (you don't need to both specify
>-mwindows and -Wl,--subsystem=console, btw) when you can just open up a
>dialog box to display the options, like every other windows program in
>the world.

I'd agree with Chris. If the output isn't visible, then put it in a dialog box
rather than mangle setup.

Hmmm. Just wonderring... Yep. OK. I see the output of stdout when setup is run
from bash. It doesn't appear if running from cmd. That explains it.

Definitely go for a dialog box.

Revised patch attached. Should these be directed exclusively at bugzilla now?

Dave.


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 
--- main.cc~	2004-10-25 19:34:32.000000000 +0100
+++ main.cc	2004-11-17 19:21:14.000000000 +0000
@@ -471,7 +471,20 @@
 
     if (HelpOption)
     {
-      GetOption::GetInstance().ParameterUsage(log(LOG_PLAIN)<<"\nCommand Line Options:\n");
+      ostringstream text(ios_base::out);
+
+      log(LOG_PLAIN) << "\nOutput command line options\n";
+      text << "setup [options]\n\n"
+	   << "Cygwin setup installs and maintains cygwin packages\n\n"
+	   << "Command Line options:\n";
+      GetOption::GetInstance().ParameterUsage(text);
+
+      ::MessageBox(NULL,
+		   text.str().c_str(),
+		   "Cygwin Setup",
+		   MB_ICONINFORMATION | MB_OK);
+
+      GetOption::GetInstance().ParameterUsage(std::cout);
       theLog->exit(0);
     }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]