@@ -667,7 +667,7 @@ namespace ts {
667
667
}
668
668
669
669
function printHelp ( ) {
670
- let output = "" ;
670
+ const output : string [ ] = [ ] ;
671
671
672
672
// We want to align our "syntax" and "examples" commands to a certain margin.
673
673
const syntaxLength = getDiagnosticText ( Diagnostics . Syntax_Colon_0 , "" ) . length ;
@@ -678,17 +678,17 @@ namespace ts {
678
678
let syntax = makePadding ( marginLength - syntaxLength ) ;
679
679
syntax += "tsc [" + getDiagnosticText ( Diagnostics . options ) + "] [" + getDiagnosticText ( Diagnostics . file ) + " ...]" ;
680
680
681
- output += getDiagnosticText ( Diagnostics . Syntax_Colon_0 , syntax ) ;
682
- output += sys . newLine + sys . newLine ;
681
+ output . push ( getDiagnosticText ( Diagnostics . Syntax_Colon_0 , syntax ) ) ;
682
+ output . push ( sys . newLine + sys . newLine ) ;
683
683
684
684
// Build up the list of examples.
685
685
const padding = makePadding ( marginLength ) ;
686
- output += getDiagnosticText ( Diagnostics . Examples_Colon_0 , makePadding ( marginLength - examplesLength ) + "tsc hello.ts" ) + sys . newLine ;
687
- output += padding + "tsc --outFile file.js file.ts" + sys . newLine ;
688
- output += padding + "tsc @args.txt" + sys . newLine ;
689
- output += sys . newLine ;
686
+ output . push ( getDiagnosticText ( Diagnostics . Examples_Colon_0 , makePadding ( marginLength - examplesLength ) + "tsc hello.ts" ) + sys . newLine ) ;
687
+ output . push ( padding + "tsc --outFile file.js file.ts" + sys . newLine ) ;
688
+ output . push ( padding + "tsc @args.txt" + sys . newLine ) ;
689
+ output . push ( sys . newLine ) ;
690
690
691
- output += getDiagnosticText ( Diagnostics . Options_Colon ) + sys . newLine ;
691
+ output . push ( getDiagnosticText ( Diagnostics . Options_Colon ) + sys . newLine ) ;
692
692
693
693
// Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch")
694
694
const optsList = filter ( optionDeclarations . slice ( ) , v => ! v . experimental ) ;
@@ -755,18 +755,20 @@ namespace ts {
755
755
const usage = usageColumn [ i ] ;
756
756
const description = descriptionColumn [ i ] ;
757
757
const kindsList = optionsDescriptionMap [ description ] ;
758
- output += usage + makePadding ( marginLength - usage . length + 2 ) + description + sys . newLine ;
758
+ output . push ( usage + makePadding ( marginLength - usage . length + 2 ) + description + sys . newLine ) ;
759
759
760
760
if ( kindsList ) {
761
- output += makePadding ( marginLength + 4 ) ;
761
+ output . push ( makePadding ( marginLength + 4 ) ) ;
762
762
for ( const kind of kindsList ) {
763
- output += kind + " " ;
763
+ output . push ( kind + " " ) ;
764
764
}
765
- output += sys . newLine ;
765
+ output . push ( sys . newLine ) ;
766
766
}
767
767
}
768
768
769
- sys . write ( output ) ;
769
+ for ( const line of output ) {
770
+ sys . write ( line ) ;
771
+ }
770
772
return ;
771
773
772
774
function getParamType ( option : CommandLineOption ) {
0 commit comments