[PATCH] Clean up 'setup --help' output a bit
Jon TURNEY
jon.turney@dronecode.org.uk
Thu Feb 23 16:27:00 GMT 2012
Avoid lines like the following preceding the useful output from 'setup --help':
io_stream_cygfile: fopen(/etc/setup/net-proxy-host) failed 2 No such file or directory
io_stream_cygfile: fopen(/etc/setup/net-proxy-port) failed 2 No such file or directory
Current Directory: \\Necker\download\cygwin
2012-02-23 Jon TURNEY <jon.turney@dronecode.org.uk>
* main.cc (main_display): Move --help output from here ...
(WinMain): ... to here, so we don't logging of the current directory and
any errors from constructing a UserSettings object preceding the --help output.
---
main.cc | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/main.cc b/main.cc
index bddff6f..5f3cc2a 100644
--- a/main.cc
+++ b/main.cc
@@ -151,13 +151,6 @@ main_display ()
log (LOG_TIMESTAMP) << "Current Directory: " << local_dir << endLog;
- if (HelpOption)
- {
- GetOption::GetInstance ().ParameterUsage (log (LOG_PLAIN)
- << "\nCommand Line Options:\n");
- theLog->exit (0);
- }
-
/* Set the default DACL and Group only on NT/W2K. 9x/ME has
no idea of access control lists and security at all. */
if (IsWindowsNT ())
@@ -318,11 +311,19 @@ main (int argc, char **argv)
log (LOG_PLAIN) << "Starting cygwin install, version "
<< setup_version << endLog;
- UserSettings Settings (local_dir);
+ if (HelpOption)
+ {
+ GetOption::GetInstance ().ParameterUsage (log (LOG_PLAIN)
+ << "\nCommand Line Options:\n");
+ }
+ else
+ {
+ UserSettings Settings (local_dir);
- main_display ();
+ main_display ();
- Settings.save (); // Clean exit.. save user options.
+ Settings.save (); // Clean exit.. save user options.
+ }
if (rebootneeded)
{
--
1.7.9
More information about the Cygwin-apps
mailing list