From: <sk...@us...> - 2003-12-01 18:32:29
|
Update of /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode.Console/SharpCvsLib/Console/Commands In directory sc8-pr-cvs1:/tmp/cvs-serv27264/src/ICSharpCode.Console/SharpCvsLib/Console/Commands Modified Files: RTagCommand.cs Log Message: Modified RTagCommand for options. Index: RTagCommand.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode.Console/SharpCvsLib/Console/Commands/RTagCommand.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RTagCommand.cs 27 Nov 2003 06:21:11 -0000 1.1 --- RTagCommand.cs 1 Dec 2003 18:32:26 -0000 1.2 *************** *** 51,54 **** --- 51,56 ---- private string fileNames; private string localDirectory; + private string revision; + private DateTime date; private string unparsedOptions; private readonly ILog LOGGER = *************** *** 108,112 **** throw e; } - return rtagCommand; } --- 110,113 ---- *************** *** 119,123 **** --- 120,175 ---- /// line options the user has selected.</param> private void ParseOptions (String rtOptions) { + int endofOptions = 0; for (int i = 0; i < rtOptions.Length; i++) { + if (rtOptions[i]== '-' && rtOptions[i+1] == 'm') { + i += 2; + // get location to place files locally + if (rtOptions.IndexOf(" -", i, rtOptions.Length - i) == -1) { + endofOptions = rtOptions.Length - i - 1; // minus one so not to + // include last space + } + else { + endofOptions = rtOptions.IndexOf(" -", i, rtOptions.Length - i) - 2; + } + localDirectory = rtOptions.Substring(i, endofOptions); + } + if (rtOptions[i]== '-' && rtOptions[i+1] == 'r') { + i += 2; + // get revision of files to tag + if (rtOptions.IndexOf(" -", i, rtOptions.Length - i) == -1) { + endofOptions = rtOptions.Length - i - 1; // minus one so not to + // include last space + } + else { + endofOptions = rtOptions.IndexOf(" -", i, rtOptions.Length - i) - 2; + } + revision = rtOptions.Substring(i, endofOptions); + } + if (rtOptions[i]== '-' && rtOptions[i+1] == 'D') { + i += 2; + // get date of files for rtag + // Date format needs to be the short date pattern as stated in the + // Control Panel -> Regional Options -> see Date tab + if (rtOptions.IndexOf(" -", i, rtOptions.Length - i) == -1) { + endofOptions = rtOptions.Length - i - 1; // minus one so not to + // include last space + } + else { + endofOptions = rtOptions.IndexOf(" -", i, rtOptions.Length - i) - 2; + } + try { + // Parse string to DateTime format + string datepar = rtOptions.Substring(i, endofOptions); + date = System.Convert.ToDateTime(datepar, DateTimeFormatInfo.CurrentInfo); + } + catch { + StringBuilder msg = new StringBuilder (); + msg.Append("The -D rtag option parameter is not "); + msg.Append("in correct format of "); + msg.Append(DateTimeFormatInfo.CurrentInfo.ShortDatePattern); + msg.Append("."); + throw new ApplicationException (msg.ToString()); + } + } if (rtOptions[i]== '-' && rtOptions[i+1] == 'a') { String msg = "The -a rtag option is not " + |