index.js
function buildOptions (options) {
  var result = [];

  var keys = Object.keys(options);

  keys.forEach(function (key) {
    var props = options[key];

    // convert short to long form
    if (is.string(props)) {
      props = {
        type: props
      };
    }

    // all names of an option
    // aliases come first
    // full name comes last
    var name = [
      format('--%s', dasherize(key))
    ];

    // accept both string and array
    var aliases = props.alias || props.aliases || [];

    if (is.not.array(aliases)) {
      aliases = [aliases];
    }

    // aliases are prefixed with "-"
    aliases.forEach(function (alias) {
      alias = format('-%s', alias);

      name.unshift(alias);
    });

    result.push([
      name.join(', '),
      props.desc || ''
    ]);
  });

  return table(result);
}
function buildOptions (options) {
  var result = [];

  var keys = Object.keys(options);

  keys.forEach(function (key) {
    var props = options[key];

    // convert short to long form
    if (is.string(props)) {
      props = {
        type: props
      };
    }

    // all names of an option
    // aliases come first
    // full name comes last
    var name = [
      format('--%s', dasherize(key))
    ];

    // accept both string and array
    var aliases = props.alias || props.aliases || [];

    if (is.not.array(aliases)) {
      aliases = [aliases];
    }

    // aliases are prefixed with "-"
    aliases.forEach(function (alias) {
      alias = format('-%s', alias);

      name.unshift(alias);
    });

    result.push([
      name.join(', '),
      props.desc || ''
    ]);
  });

  return table(result);
}
function buildOptions ( options ) { var result = [ ] ; var keys = Object . keys ( options ) ; keys . forEach ( function ( key ) { var props = options [ key ] ; // convert short to long form if ( is . string ( props ) ) { props = { type : props } ; } // all names of an option // aliases come first // full name comes last var name = [ format ( '--%s' , dasherize ( key ) ) ] ; // accept both string and array var aliases = props . alias || props . aliases || [ ] ; if ( is . not . array ( aliases ) ) { aliases = [ aliases ] ; } // aliases are prefixed with "-" aliases . forEach ( function ( alias ) { alias = format ( '-%s' , alias ) ; name . unshift ( alias ) ; } ) ; result . push ( [ name . join ( ', ' ) , props . desc || '' ] ) ; } ) ; return table ( result ) ; }
Helpers
 
Output option list
Helpers Output option list