mirror of https://github.com/winsw/winsw
Feature/eliminate newlines (#483)
* Added code to collapse newlines, line returns and groups of spaces into a single space. This is to allow users to put lots of arguments into the configuration xml using one line per argument for readability. This is really helpful when trying to wrap swarm-client.jar calls which can have a lot of long arguments. * fixed the comment text. * included tabs in the list of things to collapse. * added back in the missing space for the tab. * Switched to a regex. * Just removing newlines, line returns and tabs. * Trimming off leading and trailing whitespace. * Updated per recommendation from NextTurn.pull/486/head
parent
691b4d2945
commit
fef46672ab
|
@ -8,6 +8,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Security.AccessControl;
|
||||
using System.ServiceProcess;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
#if VNEXT
|
||||
using System.Threading.Tasks;
|
||||
|
@ -276,6 +277,11 @@ namespace winsw
|
|||
startarguments += " " + _descriptor.Arguments;
|
||||
}
|
||||
|
||||
// Converting newlines, line returns, tabs into a single
|
||||
// space. This allows users to provide multi-line arguments
|
||||
// in the xml for readability.
|
||||
startarguments = Regex.Replace(startarguments, @"\s*[\n\r]+\s*", " ");
|
||||
|
||||
LogEvent("Starting " + _descriptor.Executable + ' ' + startarguments);
|
||||
Log.Info("Starting " + _descriptor.Executable + ' ' + startarguments);
|
||||
|
||||
|
|
Loading…
Reference in New Issue