Style and comments.

This commit is contained in:
Daniel Rosenwasser
2014-08-04 12:01:27 -07:00
parent 2dd9763bad
commit e05e7836e3
2 changed files with 14 additions and 15 deletions

View File

@@ -9,10 +9,12 @@
/// <reference path="commandLineParser.ts"/>
module ts {
export var version = "1.1.0.0";
var version = "1.1.0.0";
/// Checks to see if the locale is in the appropriate format,
/// and if it is, attempt to set the appropriate language.
/**
* Checks to see if the locale is in the appropriate format,
* and if it is, attempts to set the appropriate language.
*/
function validateLocaleAndSetLanguage(locale: string, errors: Diagnostic[]): boolean {
var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase());
@@ -367,21 +369,18 @@ module ts {
output += getDiagnosticText(Diagnostics.Syntax_Colon_0, syntax);
output += sys.newLine + sys.newLine;
// Build up the examples.
// Build up the list of examples.
var padding = makePadding(marginLength);
output += getDiagnosticText(Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + sys.newLine;
output += padding + "tsc --out foo.js foo.ts" + sys.newLine;
output += padding + "tsc @args.txt" + sys.newLine;
output += sys.newLine;
// Sort our options by their command names, (e.g. "--noImplicitAny" comes before "--watch")
output += getDiagnosticText(Diagnostics.Options_Colon) + sys.newLine;
var optsList = optionDeclarations.slice().sort((a, b) => {
var aName = a.name.toLowerCase();
var bName = b.name.toLowerCase();
return compareValues(aName, bName);
});
// Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch")
var optsList = optionDeclarations.slice();
optsList.sort((a, b) => compareValues(a.name.toLowerCase(), b.name.toLowerCase()));
// We want our descriptions to align at the same column in our output,
// so we keep track of the longest option usage string.

View File

@@ -952,11 +952,11 @@ module ts {
export interface CommandLineOption {
name: string;
type: any;
shortName?: string;
description?: DiagnosticMessage;
paramName?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter.
error?: DiagnosticMessage; // The error given when the argument does not fit a customized 'type'.
type: any; // "string", "number", "boolean", or an object literal mapping named values to actual values
shortName?: string; // A short pneumonic for convenience - for instance, 'h' can be used in place of 'help'.
description?: DiagnosticMessage; // The message describing what the command line switch does
paramName?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter.
error?: DiagnosticMessage; // The error given when the argument does not fit a customized 'type'.
}
export enum CharacterCodes {