How to use the gluegun.print.table function in gluegun

To help you get started, we’ve selected a few gluegun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zce / zce-cli / src / extensions / help-extension.ts View on Github external
print.newline()
    print.info('Options:')
    if (message.options instanceof Array) {
      print.table(message.options)
    } else {
      print.table(
        Object.keys(message.options).map(k => [k, (message.options as {})[k]])
      )
    }
  }

  if (message.examples) {
    print.newline()
    print.info('Examples:')
    if (typeof message.examples === 'string') {
      print.table([[message.examples]])
    } else {
      print.table(message.examples.map(i => [i]))
    }
  }

  if (message.suggestions) {
    print.newline()
    print.info('Suggestions:')
    if (typeof message.suggestions === 'string') {
      print.table([[message.suggestions]])
    } else {
      print.table(message.suggestions.map(i => [i]))
    }
  }
}
github zce / zce-cli / src / extensions / help-extension.ts View on Github external
return print.info(message)
  }

  if (message.description) {
    print.info(message.description)
    print.newline()
  }

  print.info('Usage:')
  print.info(`  $ ${message.usage}`)

  if (message.commands) {
    print.newline()
    print.info('Commands:')
    if (message.commands instanceof Array) {
      print.table(message.commands)
    } else {
      print.table(
        Object.keys(message.commands).map(k => [k, (message.commands as {})[k]])
      )
    }
  }

  if (message.options) {
    print.newline()
    print.info('Options:')
    if (message.options instanceof Array) {
      print.table(message.options)
    } else {
      print.table(
        Object.keys(message.options).map(k => [k, (message.options as {})[k]])
      )
github zce / zce-cli / src / extensions / help-extension.ts View on Github external
print.newline()
    print.info('Commands:')
    if (message.commands instanceof Array) {
      print.table(message.commands)
    } else {
      print.table(
        Object.keys(message.commands).map(k => [k, (message.commands as {})[k]])
      )
    }
  }

  if (message.options) {
    print.newline()
    print.info('Options:')
    if (message.options instanceof Array) {
      print.table(message.options)
    } else {
      print.table(
        Object.keys(message.options).map(k => [k, (message.options as {})[k]])
      )
    }
  }

  if (message.examples) {
    print.newline()
    print.info('Examples:')
    if (typeof message.examples === 'string') {
      print.table([[message.examples]])
    } else {
      print.table(message.examples.map(i => [i]))
    }
  }
github zce / zce-cli / src / extensions / help-extension.ts View on Github external
print.newline()
    print.info('Examples:')
    if (typeof message.examples === 'string') {
      print.table([[message.examples]])
    } else {
      print.table(message.examples.map(i => [i]))
    }
  }

  if (message.suggestions) {
    print.newline()
    print.info('Suggestions:')
    if (typeof message.suggestions === 'string') {
      print.table([[message.suggestions]])
    } else {
      print.table(message.suggestions.map(i => [i]))
    }
  }
}