#! /usr/bin/env node
const args = require('../args') // TODO
const path = require('path')

const gest = require('../src/index')
const REPL = require('../src/REPL')
const { readFile, checkPath, flagsToOptions, colorResponse } = require('../src/util')

args
  .option('header', 'HTTP request header')
  .option('baseUrl', 'Base URL for sending HTTP requests')

const flags = args.parse(process.argv)

try {
  if (!flags.help && !flags.version) {
    let config
    try {
      config = require(path.join(process.cwd(), 'package.json')).gest
    } catch (e) {}

    const options = Object.assign({ schema: 'schema.js' }, config, flagsToOptions(flags))

    const schema = require(path.join(process.cwd(), options.schema))

    if (args.sub && args.sub.length) {
      checkPath(path.join(process.cwd(), args.sub[0]))
      .then(readFile)
      .catch(() => args.sub[0])
      .then(gest(schema, options))
      .then(colorResponse)
      .then(console.log)
      .catch(console.log)
    } else {
      // REPL
      REPL(schema, options)
    }
  }
} catch (e) {
  switch (e.code) {
    case 'MODULE_NOT_FOUND':
      console.log('\nSchema not found. Trying running `gest` with your `schema.js` in the current working directory.\n')
      break
    default: console.log(e)
  }
}

@@ -82,16 +82,59 @@
 ('path')
+%0Aconst %7B printSchema %7D = require('graphql')
 %0A%0Aconst 
@@ -393,16 +393,81 @@
 quests')
+%0A  .option(%5B'I', 'inspect'%5D, 'Print your GraphQL schema options')
 %0A%0Aconst 
@@ -747,24 +747,24 @@
 ns(flags))%0A%0A
-
     const sc
@@ -817,24 +817,116 @@
 s.schema))%0A%0A
+    if (flags.inspect) %7B%0A      console.log(printSchema(schema))%0A      process.exit()%0A    %7D%0A%0A
     if (args

Add inspect flag