diff --git a/generators/app/USAGE b/generators/app/USAGE index 71ee6af..37297ff 100644 --- a/generators/app/USAGE +++ b/generators/app/USAGE @@ -12,10 +12,3 @@ Example: messages/install.txt default install.txt file messages/version.txt default version.txt file messages.json default messages.json file - - Variables: - sublime_version - package_name - package_description - github_username - github_fullname \ No newline at end of file diff --git a/generators/app/index.js b/generators/app/index.js index f7a342e..1c0c8b3 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -13,6 +13,21 @@ const prompts = []; module.exports = class extends Generator { + // Arguments and options should be defined in the constructor. + constructor(args, opts) { + super(args, opts); + + // This method adds support for a `--generator-description` flag + this.option('generator-description', { + type: Boolean, + description: 'Shows the description of each sub-generator.', + default: false, + alias: 'd', + hide: false, + }); + + } + // initializing - Your initialization methods (checking current project state, getting configs, etc) async initializing() { diff --git a/generators/macro/config.js b/generators/macro/config.js index e9046cc..fbc72ac 100644 --- a/generators/macro/config.js +++ b/generators/macro/config.js @@ -1,6 +1,6 @@ const config = { name: 'Macro', - description: 'Creates a Default.sublime-macro file. Macros are a basic automation facility comprising sequences of commands. Use them whenever you need to repeat the exact same steps to perform an operation.', + description: 'Creates a Default.sublime-macro file. Macros are a basic automation facility comprising sequences of commands.', priority: 60, versions: { '4.0.x': '', diff --git a/generators/mousemap/config.js b/generators/mousemap/config.js index 96b6c4e..a7ef09a 100644 --- a/generators/mousemap/config.js +++ b/generators/mousemap/config.js @@ -1,6 +1,6 @@ const config = { name: 'Mousemap', - description: 'Creates a Default.sublime-mousemap file. The mousemap files (which have the extension .sublime-mousemap) control what commands are executed when a user performs an action with a mouse, e.g. clicking a mouse button, scrolling the scroll wheel, etc.', + description: 'Creates a Default.sublime-mousemap file, which control what commands are executed when a user performs an action with a mouse.', priority: 80, versions: { '4.0.x': '', diff --git a/src/helper.js b/src/helper.js index 33fd01a..c487726 100644 --- a/src/helper.js +++ b/src/helper.js @@ -81,8 +81,13 @@ async function GetsupportedVersions(Generator, config) { const generator_name = generator_config.name || changeCase.capitalCase(generator); + let name = generator_name; + if (Generator.options['generator-description']) { + name = generator_name + ' \t - ' + generator_config.description; + } + const generator_data = { - name: generator_name + ' \t - ' + generator_config.description, + name: name, description: generator_config.description, value: generator, checked: false,