 
     test:
       help: 'Run tests for a brunch project'
-      opts:
+      options:
         verbose:
           flag: yes
           help: 'set verbose option for test runner'
       callback: (options) ->
         brunch.test parseOpts options
 
-  globalOpts:
+  options:
     version:
       abbr: 'v'
       help: 'display brunch version'
       flag: yes
       callback: -> brunch.VERSION
 
-  scriptName: 'brunch'
-
-  help: (parser) ->
-    str = 'commands:\n'
-    {commands, script} = parser.usage()
-    for name, command of commands
-      str += "   #{script} #{command.name}: #{command.help}\n"
-    str += '''\n
-      To get help on individual command, execute `brunch <command> --help`
-    '''
-    str
-
-
-class CommandParser
-  _setUpParser: ->
-    parser = require 'nomnom'
-    for name, data of @config
-      switch name
-        when 'commands'
-          for cmdName, cmdData of data
-            command = parser.command cmdName
-            for attrName, value of cmdData
-              command[attrName] value
-        else
-          data = data parser if typeof data is 'function'
-          parser[name] data
-    parser
-
-  parse: ->
-    @_parser.parseArgs()
-    process.stdout.write @_parser.getUsage() unless process.argv[2]
-
-  constructor: (@config) ->
-    @_parser = @_setUpParser()
 
 exports.run = ->
-  (new CommandParser config).parse()
-
+  args.parse config

path = require 'path'
yaml = require 'yaml'
fs = require 'fs'

brunch = require './brunch'
helpers = require './helpers'

          help: 'build path'
          metavar: 'DIRECTORY'
          full: 'output'
      callback: (options) ->
        brunch.new options, ->
          brunch.build parseOpts options

    build:
      help: 'Build a brunch project'
      options:
        buildPath:
          abbr: 'o'
          help: 'build path'
