1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | 1 1 1 1 | /** * Copyright (c) 2011, Yahoo! Inc. All rights reserved. * Code licensed under the BSD License: * https://github.com/yui/yuidoc/blob/master/LICENSE */ 'use strict'; YUI.add('help', function (Y) { /** * Shows the help text * @module yuidoc * @class Help */ /** * The help text to display * @private * @property help * @type Array */ var help = [ '', 'YUI Doc generates API documentation from a modified JavaDoc syntax.', '', 'Current version ({VERSION})', '', 'Usage: yuidoc <options> <input path>', '', 'Common Options:', ' -c, --config, --configfile <filename> A JSON config file to provide configuration data.', ' You can also create a yuidoc.json file and place it', ' anywhere under your source tree and YUI Doc will find it', ' and use it.', ' -e, --extension <comma sep list of file extensions> The list of file extensions to parse ', ' for api documentation. (defaults to .js)', ' -x, --exclude <comma sep list of directories> Directories to exclude from parsing ', ' (defaults to \'.DS_Store,.svn,CVS,.git,build_rollup_tmp,build_tmp\')', ' -v, --version Show the current YUIDoc version', ' --project-version Set the doc version for the template', ' -N, --no-color Turn off terminal colors (for automation)', ' -C, --no-code Turn off code generation (don\'t include source files in output)', ' -n, --norecurse Do not recurse directories (default is to recurse)', ' --no-sort Do not alphabetical sorting of attributes, events, methods, and properties', ' -S, --selleck Look for Selleck component data and attach to API meta data', ' -V, --view Dump the Handlebars.js view data instead of writing template files', ' -p, --parse-only Only parse the API docs and create the JSON data, do not render templates', ' -o, --outdir <directory path> Path to put the generated files (defaults to ./out)', ' -t, --themedir <directory path> Path to a custom theme directory containing Handlebars templates', ' -H, --helpers <comma separated list of paths to files> Require these file and add Handlebars helpers. See docs for more information', ' --charset CHARSET Use this as the default charset for all file operations. Defaults to \'utf8\'', ' -h, --help Show this help', ' -q, --quiet Supress logging output', ' -T, --theme <simple|default> Choose one of the built in themes (default is default)', ' --syntaxtype <js|coffee> Choose comment syntax type (default is js)', ' --server <port> Fire up the YUIDoc server for faster API doc developement. Pass optional port to listen on. (default is 3000)', ' --lint Lint your docs, will print parser warnings and exit code 1 if there are any', '', ' <input path> Supply a list of paths (shell globbing is handy here)', '' ].join('\n'); /** * Render the help message as a string * @method renderHelp * @return {String} The help screen to display */ Y.renderHelp = function () { return Y.Lang.sub(help, { VERSION: Y.packageInfo.version }); }; /** * Display the help message, write it to the screen and exit * @method showHelp */ Y.showHelp = function () { console.error(Y.renderHelp()); process.exit(0); //Shouldn't exit one on help }; }); |