 #!/usr/bin/env coffee
-
-#{
-#    "type": "object",
-#    "properties": {
-#      "on": {
-#        "type": "boolean",
-#        "required": true,
-#        "default": false
-#      },
-#      "color": {
-#        "type": "string",
-#        "required": true
-#      }
-#    }
-#  }
-
 
 fs = require 'fs'
 _  = require 'lodash'

  .option('-i, --infile [path]',  'Path to the channel file to input')
  .option('-o, --outfile [path]',  'Path to the channel file to output')
  .option('-f, --form [path]',  'Path to the schema form file to output')
  .parse(process.argv);

commander.help() unless commander.infile?

converter = new ParseChannelSchemaToJSONSchema channel_infile: commander.infile?,
  channel_outfile: commander.outfile?
converter.run()


  writeOutput: (channel) =>
    prettyChannel = JSON.stringify channel, null, 2
    fs.writeFileSync @messageSchemaFile, prettyChannel
    debug 'channel output:', prettyChannel

  writeForm: (form) =>
    prettyForm = JSON.stringify form, null, 2
    fs.writeFileSync @formFile, prettyForm
    debug 'form output:', prettyForm

commander
