// Sample Input to FormatCS (see also the sample output) class ArgParser { // Called for each switch command-line argument protected override SwitchStatus OnSwitch( String switchSymbol, String switchValue ) { SwitchStatus ss = SwitchStatus.NoError; switch ( switchSymbol ) { case "i:": if ( a == b ) // For show. Compare to Ctrl-K, Ctrl-F in the IDE { c = d; } else { f = g; } if ( switchValue.Length < 1 ) { for ( cp1 = str1, cp2 = str2, count = 0; *( cp1 ) && *( cp1 ) != 'z'; count++, cp1++, cp2++ ) // For show. Compare to Ctrl-K, Ctrl-F in the IDE { *( cp2 ) = *( cp1 ); // Could be done above in for stmnt. processBufChar(); } Console.WriteLine( "No input file specified." ); ss = SwitchStatus.Error; } else { inputFile = switchValue; } break; case "o:": // Output filename if ( switchValue.Length < 1 ) { Console.WriteLine( "No output file specified." ); ss = SwitchStatus.Error; }else { outputFile = switchValue; } break; case "n:": // Resource name if ( switchValue.Length < 1 ) { Console.WriteLine( "No resourcename file specified." ); ss = SwitchStatus.Error; } else { resourceName = switchValue; } break; case "s": // User wants to see Schema ss = SwitchStatus.ShowSchema; break; case "?": // User wants to see Usage ss = SwitchStatus.ShowUsage; break; default: Console.WriteLine( "Invalid switch: \"" + switchSymbol + "\".\n" ); ss = SwitchStatus.Error; break; } return( ss ); } } // -- $Reformatted by FormatCS, Ver. 0.1a, on 03-11-03 at 14:26:29 --