lib/gcli/types/command.js
function(option) {
    if (arg.text.length === 0) {
      // If someone hasn't typed anything, we only show top level commands in
      // the menu. i.e. sub-commands (those with a space in their name) are
      // excluded. We do this to keep the list at an overview level.
      if (option.name.indexOf(' ') === -1) {
        predictions.push(option);
      }
    }
    else {
      // If someone has typed something, then we exclude parent commands
      // (those without an exec). We do this because the user is drilling
      // down and doesn't need the summary level.
      if (option.value.exec != null) {
        predictions.push(option);
      }
    }
  }
function(option) {
    if (arg.text.length === 0) {
      // If someone hasn't typed anything, we only show top level commands in
      // the menu. i.e. sub-commands (those with a space in their name) are
      // excluded. We do this to keep the list at an overview level.
      if (option.name.indexOf(' ') === -1) {
        predictions.push(option);
      }
    }
    else {
      // If someone has typed something, then we exclude parent commands
      // (those without an exec). We do this because the user is drilling
      // down and doesn't need the summary level.
      if (option.value.exec != null) {
        predictions.push(option);
      }
    }
  }
function ( option ) { if ( arg . text . length === 0 ) { // If someone hasn't typed anything, we only show top level commands in // the menu. i.e. sub-commands (those with a space in their name) are // excluded. We do this to keep the list at an overview level. if ( option . name . indexOf ( ' ' ) === - 1 ) { predictions . push ( option ) ; } } else { // If someone has typed something, then we exclude parent commands // (those without an exec). We do this because the user is drilling // down and doesn't need the summary level. if ( option . value . exec != null ) { predictions . push ( option ) ; } } }
Add an option to our list of predicted options
Add an option to our list of predicted options