code: function(name, options) {
          if (typeof options === 'function') {
            return options(name);
          }
          if (options && typeof options.toAlias === 'function') {
            return options.toAlias(name);
          }
          if (typeof app.options.toAlias === 'function') {
            return app.options.toAlias(name);
          }
          return name;
        }
docs: Create a generator alias from the given `name`. By default the alias
  is the string after the last dash. Or the whole string if no dash exists.
  
  ```js
  var camelcase = require('camel-case');
  var alias = app.toAlias('foo-bar-baz');
  //=> 'baz'
  
  // custom `toAlias` function
  app.option('toAlias', function(name) {
  return camelcase(name);
  });
  var alias = app.toAlias('foo-bar-baz');
  //=> 'fooBarBaz'
  ```
  @name .toAlias
  @param {String} `name`
  @param {Object} `options`
  @return {String} Returns the alias.
  @api public