* Outputs the help screen to the CLI. * @return {void}
()
| 175 | * @return {void} |
| 176 | */ |
| 177 | function outputHelp() { |
| 178 | var lenToPad = 40, |
| 179 | toPrint = "", |
| 180 | formatString = ""; |
| 181 | |
| 182 | api.print([ |
| 183 | "\nUsage: csslint-rhino.js [options]* [file|dir]*", |
| 184 | " ", |
| 185 | "Global Options" |
| 186 | ].join("\n")); |
| 187 | |
| 188 | for (var optionName in globalOptions) { |
| 189 | if (globalOptions.hasOwnProperty(optionName)) { |
| 190 | // Print the option name and the format if present |
| 191 | toPrint += " --" + optionName; |
| 192 | if (globalOptions[optionName].format !== "") { |
| 193 | formatString = "=" + globalOptions[optionName].format; |
| 194 | toPrint += formatString; |
| 195 | } else { |
| 196 | formatString = ""; |
| 197 | } |
| 198 | |
| 199 | // Pad out with the appropriate number of spaces |
| 200 | toPrint += new Array(lenToPad - (optionName.length + formatString.length)).join(" "); |
| 201 | |
| 202 | // Print the description |
| 203 | toPrint += globalOptions[optionName].description + "\n"; |
| 204 | } |
| 205 | } |
| 206 | api.print(toPrint); |
| 207 | } |
| 208 | |
| 209 | /** |
| 210 | * Given an Array of filenames, print wrapping output and process them. |
no outgoing calls
no test coverage detected
searching dependent graphs…