-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored AppRunner and Console Main to use smaller methods. #280
base: master
Are you sure you want to change the base?
Conversation
ConsoleMain.cs -- Took logic out of this class and moved it to MainRunner.cs AppRunner.cs, MainRunner.cs -- extracted functionality of longer methods into smaller methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my thoughts on this PR...
private static void DisplayHelp(OptionSet opts) | ||
|
||
private void DisplayHelp(OptionSet opts) | ||
{ | ||
Assembly thisApp = Assembly.GetExecutingAssembly(); | ||
Stream helpStream = thisApp.GetManifestResourceStream("ThoughtWorks.CruiseControl.Console.Help.txt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some using(Stream sr = ...) would ensure the streams are properly handled in case of an error.
I also see no need for the WriteHelpToConsole method since it's used only here.
useShadowCopying); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I prefer public methods to appear first in a class and then the protected/private ones.
} | ||
catch (RemotingException) | ||
{ | ||
// Sometimes this exception gets thrown and not sure why. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to log the RemotingException errors at debug level.
ConsoleMain.cs -- Took logic out of this class and moved it to MainRunner.cs
AppRunner.cs, MainRunner.cs -- extracted functionality of longer methods into smaller methods