lib/doc/doc.js
function(program) {
  this.cli = program;
  this.cmd = this.cli;
  if(process.env.CLI_TOOLKIT_HELP_CMD) {
    var alias = this.cli.finder.getCommandByName;
    var cmd = alias(process.env.CLI_TOOLKIT_HELP_CMD, this.cli.commands());
    if(cmd) {
      this.cmd = cmd;
    }
  }
  this.eol = eol;
  this.format = fmt.TEXT_FORMAT;
  this.help2man = !!process.env.help2man;
  this.conf = this.cli.configure().help;
  this.vanilla = this.conf.vanilla;
  if(this.colon === undefined) {
    this.colon = typeof(this.conf.colon) === 'boolean' ? this.conf.colon : true;
  }
  this.messages = this.conf.messages;
  this.limit = this.conf.maximum ? this.conf.maximum : 80;
  this.usage = this.cli.usage();
  this.delimiter = this.conf.delimiter ? this.conf.delimiter : ', ';
  this.assignment = this.conf.assignment ? this.conf.assignment : '=';
  this.align = this.conf.align || columns.COLUMN_ALIGN;
  this.collapse = this.conf.collapse;
  if(!~columns.align.indexOf(this.align)) {
    this.align = columns.COLUMN_ALIGN;
  }
  this.sections = sections.slice(0);

  var i, k;

  // custom unknown sections in help conf
  if(this.cmd.sections()) {
    var ckeys = Object.keys(this.cmd.sections());
    // custom sections come after options
    var ind = this.sections.indexOf(manual.OPTIONS) + 1;
    for(i = 0;i < ckeys.length;i++) {
      k = ckeys[i].toLowerCase();
      if(!~this.sections.indexOf(k)) {
        // inject into section list
        this.sections.splice(ind, 0, k);
        ind++;
      }
    }
  }

  this.padding = this.conf.indent;
  this.space = this.conf.space || repeat(this.padding);
  this.wraps = true;
  this.width = this.conf.width;
  // whether to use columns
  this.use = this.format === fmt.TEXT_FORMAT;
  this.headers = {};
  for(k in headers) {
    this.headers[k] = headers[k];
  }
  this.metrics = {};
  this.getMetrics();
  this.titles();
}
function(program) {
  this.cli = program;
  this.cmd = this.cli;
  if(process.env.CLI_TOOLKIT_HELP_CMD) {
    var alias = this.cli.finder.getCommandByName;
    var cmd = alias(process.env.CLI_TOOLKIT_HELP_CMD, this.cli.commands());
    if(cmd) {
      this.cmd = cmd;
    }
  }
  this.eol = eol;
  this.format = fmt.TEXT_FORMAT;
  this.help2man = !!process.env.help2man;
  this.conf = this.cli.configure().help;
  this.vanilla = this.conf.vanilla;
  if(this.colon === undefined) {
    this.colon = typeof(this.conf.colon) === 'boolean' ? this.conf.colon : true;
  }
  this.messages = this.conf.messages;
  this.limit = this.conf.maximum ? this.conf.maximum : 80;
  this.usage = this.cli.usage();
  this.delimiter = this.conf.delimiter ? this.conf.delimiter : ', ';
  this.assignment = this.conf.assignment ? this.conf.assignment : '=';
  this.align = this.conf.align || columns.COLUMN_ALIGN;
  this.collapse = this.conf.collapse;
  if(!~columns.align.indexOf(this.align)) {
    this.align = columns.COLUMN_ALIGN;
  }
  this.sections = sections.slice(0);

  var i, k;

  // custom unknown sections in help conf
  if(this.cmd.sections()) {
    var ckeys = Object.keys(this.cmd.sections());
    // custom sections come after options
    var ind = this.sections.indexOf(manual.OPTIONS) + 1;
    for(i = 0;i < ckeys.length;i++) {
      k = ckeys[i].toLowerCase();
      if(!~this.sections.indexOf(k)) {
        // inject into section list
        this.sections.splice(ind, 0, k);
        ind++;
      }
    }
  }

  this.padding = this.conf.indent;
  this.space = this.conf.space || repeat(this.padding);
  this.wraps = true;
  this.width = this.conf.width;
  // whether to use columns
  this.use = this.format === fmt.TEXT_FORMAT;
  this.headers = {};
  for(k in headers) {
    this.headers[k] = headers[k];
  }
  this.metrics = {};
  this.getMetrics();
  this.titles();
}
function ( program ) { this . cli = program ; this . cmd = this . cli ; if ( process . env . CLI_TOOLKIT_HELP_CMD ) { var alias = this . cli . finder . getCommandByName ; var cmd = alias ( process . env . CLI_TOOLKIT_HELP_CMD , this . cli . commands ( ) ) ; if ( cmd ) { this . cmd = cmd ; } } this . eol = eol ; this . format = fmt . TEXT_FORMAT ; this . help2man = ! ! process . env . help2man ; this . conf = this . cli . configure ( ) . help ; this . vanilla = this . conf . vanilla ; if ( this . colon === undefined ) { this . colon = typeof ( this . conf . colon ) === 'boolean' ? this . conf . colon : true ; } this . messages = this . conf . messages ; this . limit = this . conf . maximum ? this . conf . maximum : 80 ; this . usage = this . cli . usage ( ) ; this . delimiter = this . conf . delimiter ? this . conf . delimiter : ', ' ; this . assignment = this . conf . assignment ? this . conf . assignment : '=' ; this . align = this . conf . align || columns . COLUMN_ALIGN ; this . collapse = this . conf . collapse ; if ( ! ~ columns . align . indexOf ( this . align ) ) { this . align = columns . COLUMN_ALIGN ; } this . sections = sections . slice ( 0 ) ; var i , k ; // custom unknown sections in help conf if ( this . cmd . sections ( ) ) { var ckeys = Object . keys ( this . cmd . sections ( ) ) ; // custom sections come after options var ind = this . sections . indexOf ( manual . OPTIONS ) + 1 ; for ( i = 0 ; i < ckeys . length ; i ++ ) { k = ckeys [ i ] . toLowerCase ( ) ; if ( ! ~ this . sections . indexOf ( k ) ) { // inject into section list this . sections . splice ( ind , 0 , k ) ; ind ++ ; } } } this . padding = this . conf . indent ; this . space = this . conf . space || repeat ( this . padding ) ; this . wraps = true ; this . width = this . conf . width ; // whether to use columns this . use = this . format === fmt . TEXT_FORMAT ; this . headers = { } ; for ( k in headers ) { this . headers [ k ] = headers [ k ] ; } this . metrics = { } ; this . getMetrics ( ) ; this . titles ( ) ; }
Abstract super class for help documents.

@param program The program instance.
Abstract super class for help documents .